Skip to content

run_store_command

MCP tools › Databases

Run a console command on a MongoDB or Redis store. MongoDB: shell forms only (show, find/sort/limit, aggregate, insert/update/replace/delete, index and collection commands, db.runCommand) with relaxed Extended JSON; no JavaScript. Redis: one command per line as in redis-cli; KEYS refused on large databases (use SCAN). Each command needs the store's right (read-data, modify-data, or modify-schema for admin and unknown commands); read-only stores refuse changes; empty-filter deleteMany/updateMany, drop(), FLUSHDB and FLUSHALL need confirm true.

Its results carry text from database: the client is told to treat that as data, never as instructions.

Capabilitydatabase.run_store_command
AreaDatabases
Accesschanges database
Reachesdatabase, network
Rightsdatabase-permission, trusted-project
Dry runapply, on unless the call turns it off

Arguments

ArgumentTypeDescription
storerequiredstringStore id or name from list_stores.
commandrequiredstringMongoDB: one console command such as db.items.find({price: {$gt: 5}}).limit(10) (SPEC-0311 subset, no JavaScript); Redis: commands, one per line, quoted as in redis-cli.
databasestringMongoDB: database for the command (use is not kept between calls); the URL's otherwise.
pageintegerMongoDB: page of a find/aggregate result (0-based).minimum 0
page_sizeintegerMongoDB: documents per page (default 50, at most 1000).minimum 0
confirmbooleanAnswer the confirmation for deleteMany/updateMany with an empty filter, drop(), FLUSHDB and FLUSHALL (the first call without it reports what would be affected).
applybooleanReally send a command that changes the store; without it such a command only returns its class and the permission it needs (SPEC-0012 v3 behaviour 14). Reads run at once.

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 run_store_command '{"store":"<string>","command":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"store",
"command"
],
"properties": {
"store": {
"description": "Store id or name from `list_stores`.",
"type": "string"
},
"command": {
"description": "MongoDB: one console command such as `db.items.find({price: {$gt: 5}}).limit(10)`\n(SPEC-0311 subset, no JavaScript); Redis: commands, one per line, quoted as in redis-cli.",
"type": "string"
},
"database": {
"description": "MongoDB: database for the command (`use` is not kept between calls); the URL's otherwise.",
"type": [
"string",
"null"
],
"default": null
},
"page": {
"description": "MongoDB: page of a find/aggregate result (0-based).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0
},
"page_size": {
"description": "MongoDB: documents per page (default 50, at most 1000).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0
},
"confirm": {
"description": "Answer the confirmation for deleteMany/updateMany with an empty filter, drop(), FLUSHDB and\nFLUSHALL (the first call without it reports what would be affected).",
"type": [
"boolean",
"null"
],
"default": null
},
"apply": {
"description": "Really send a command that changes the store; without it such a command only returns its\nclass and the permission it needs (`SPEC-0012` v3 behaviour 14). Reads run at once.",
"type": [
"boolean",
"null"
],
"default": null
}
}
}