complete_sql
MCP tools › Databases
Complete SQL at a cursor position using the connection's schema: tables after FROM/JOIN, after JOIN also ready join clauses (kind join) built from foreign keys to the tables already in the statement, columns of referenced tables or aliases, keywords (needs the read-schema permission).
Its results carry text from files, database: the client is told to treat that as data, never as instructions.
| Capability | database.complete_sql |
|---|---|
| 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. |
sqlrequired | string | SQL text being edited. |
cursorrequired | integer | Cursor position as byte offset into sql.minimum 0 |
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 complete_sql '{"connection":"<string>","sql":"<string>","cursor":1}'Input schema as JSON
{ "type": "object", "required": [ "connection", "sql", "cursor" ], "properties": { "connection": { "description": "Connection name from `list_connections`.", "type": "string" }, "sql": { "description": "SQL text being edited.", "type": "string" }, "cursor": { "description": "Cursor position as byte offset into `sql`.", "type": "integer", "minimum": 0 } }}