sql_history
MCP tools › Databases
The query history of a connection: the statements its consoles in the window ran, newest first, with time (seconds since 1970) and whether they succeeded. Kept in the user's settings folder, never in the workspace; statements with passwords are never kept. Optional query (text to contain) and limit (default 50). Needs the read-data permission of the connection.
Its results carry text from database: the client is told to treat that as data, never as instructions.
| Capability | database.sql_history |
|---|---|
| Area | Databases |
| Access | reads only |
| Reaches | database |
| Rights | ssh, database-permission, trusted-project |
| Dry run | none |
Arguments
| Argument | Type | Description |
|---|---|---|
connectionrequired | string | Connection name from list_connections. |
query | string | Only statements containing this text (case-insensitive). |
limit | integer | At most this many entries, newest first (default 50).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 sql_history '{"connection":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "connection" ], "properties": { "connection": { "description": "Connection name from `list_connections`.", "type": "string" }, "query": { "description": "Only statements containing this text (case-insensitive).", "type": [ "string", "null" ], "default": null }, "limit": { "description": "At most this many entries, newest first (default 50).", "type": [ "integer", "null" ], "default": null, "minimum": 0 } }}