Skip to main content
Glama
bvisible

MCP SSH Manager

by bvisible

ssh_db_query

Runs a read-only query against a remote database. For mysql and postgresql it is strictly limited to one SELECT statement: the query must begin with SELECT, and INTO, file functions, and any insert, update, delete, drop, create, alter…

Instructions

Runs a read-only query against a remote database. For mysql and postgresql it is strictly limited to one SELECT statement: the query must begin with SELECT, and INTO, file functions, and any insert, update, delete, drop, create, alter, truncate, grant, revoke, or exec keyword are rejected before execution; it then runs inside a read-only transaction, so the database itself refuses any write. For mongodb it runs a find() and requires the collection parameter; the query must be a filter document (JSON or mongo shell syntax such as ObjectId("…")), and $where, $function and $accumulator are refused. Returns the raw command output as text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesDatabase type
queryYesSQL query (SELECT only) or MongoDB find query
dbHostNoDatabase host (default: localhost)
dbPortNoDatabase port
dbUserNoDatabase user
serverYesServer name
databaseYesDatabase name
collectionNoCollection name (MongoDB only)
dbPasswordNoDatabase password

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.8.5
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so thoroughly: it explains pre-execution keyword validation, that the statement then runs inside a read-only transaction so the database itself refuses writes, and the MongoDB-specific bans on $where/$function/$accumulator. It also discloses the return format as raw command text.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences that are front-loaded with the core read-only contract before the per-dialect rules; nothing is filler. It is somewhat long, but the length is driven by genuinely distinct per-dialect behavior rather than padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the 9-parameter, 3-dialect surface plus the conditional MongoDB requirement, and explicitly states the return value ('raw command output as text') even though no output schema exists. An agent has everything needed to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: it states that the MongoDB path requires the collection parameter (which is not listed in the schema's required array), that query must be a filter document, and that mysql/postgresql query must begin with SELECT.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (runs) plus resource (read-only query against a remote database) and constrains the operation to SELECT/find, which cleanly separates it from write-oriented siblings like ssh_db_import and ssh_db_dump. An agent can tell what this does without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The read-only framing and the enumerated rejections (insert, update, delete, drop, exec, $where, etc.) effectively communicate when this tool is and isn't usable, and imply that write work belongs elsewhere. It stops short of naming a concrete alternative such as ssh_db_import for writing or ssh_db_list for enumeration.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.