Skip to content

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.

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

Arguments

ArgumentTypeDescription
connectionrequiredstringConnection name from list_connections.
sqlrequiredstringSQL text being edited.
cursorrequiredintegerCursor 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.

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