object_definition
MCP tools › Databases
The definition of a function, procedure, aggregate, trigger or type as the database states it: PostgreSQL pg_get_functiondef and pg_get_triggerdef, aggregates and types (enum, domain, range, composite) written from the catalogue; MySQL and MariaDB SHOW CREATE FUNCTION/PROCEDURE/TRIGGER; SQLite the stored CREATE TRIGGER. Name the object as schema_objects lists it: kind and name, with table for a trigger and detail (the arguments) for an overloaded PostgreSQL routine. Returns the object with ddl; nothing is run but the catalogue query (needs the read-schema permission).
Its results carry text from database: the client is told to treat that as data, never as instructions.
| Capability | database.object_definition |
|---|---|
| Area | Databases |
| Access | reads only |
| Reaches | database, network |
| Rights | ssh, database-permission, trusted-project |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
connectionrequired | string | Connection name from list_connections. |
schema | string | Schema from list_schemas (default: the current schema). |
kindrequired | string | The object's kind as schema_objects gives it: function, procedure, aggregate,
trigger or type. |
namerequired | string | The object's name. |
table | string | A trigger's table, when triggers of several tables share the name. |
detail | string | A PostgreSQL routine's arguments as schema_objects gives them, e.g. (amount numeric),
when the name is overloaded. |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project object_definition '{"connection":"<string>","kind":"<string>","name":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "connection", "kind", "name" ], "properties": { "connection": { "description": "Connection name from `list_connections`.", "type": "string" }, "schema": { "description": "Schema from `list_schemas` (default: the current schema).", "type": [ "string", "null" ], "default": null }, "kind": { "description": "The object's kind as `schema_objects` gives it: `function`, `procedure`, `aggregate`,\n`trigger` or `type`.", "type": "string" }, "name": { "description": "The object's name.", "type": "string" }, "table": { "description": "A trigger's table, when triggers of several tables share the name.", "type": [ "string", "null" ], "default": null }, "detail": { "description": "A PostgreSQL routine's arguments as `schema_objects` gives them, e.g. `(amount numeric)`,\nwhen the name is overloaded.", "type": [ "string", "null" ], "default": null } }}