Skip to content

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.

Capabilitydatabase.object_definition
AreaDatabases
Accessreads only
Reachesdatabase, network
Rightsssh, database-permission, trusted-project
Dry runnone

Arguments

ArgumentTypeDescription
connectionrequiredstringConnection name from list_connections.
schemastringSchema from list_schemas (default: the current schema).
kindrequiredstringThe object's kind as schema_objects gives it: function, procedure, aggregate, trigger or type.
namerequiredstringThe object's name.
tablestringA trigger's table, when triggers of several tables share the name.
detailstringA 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.

Terminal window
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
}
}
}