Skip to content

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.

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

Arguments

ArgumentTypeDescription
connectionrequiredstringConnection name from list_connections.
querystringOnly statements containing this text (case-insensitive).
limitintegerAt 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.

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