Skip to main content
Glama

data_query

Destructive

Run a database query on one of your servers — passwordless. It executes the engine's own client on the host over Termalin's keyless tunnel, using the database's local trust (Postgres peer auth via sudo -u postgres, MySQL/MariaDB unix-socket via sudo mysql, redis-cli, mongosh, sqlite3) — so no database password is needed or stored anywhere. Without sudo (shared hosting) the client runs as the login user, so MySQL/MariaDB uses its ~/.my.cnf. Read-only by default: only SELECT/SHOW-style statements run unless allowWrites is set (full-access keys only). SQL engines return CSV/TSV with a header. For MongoDB pass a shell expression, e.g. db.products.find({}).limit(20).toArray().

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "host": "<host>",
      "query": "<query>"
    },
    "name": "data_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesServer id from hosts_list
queryYesThe statement / command / expression to run
engineNoDatabase engine on that server (default postgres)
databaseNoDatabase name (for sqlite: the .db file path)
usernameNoSSH login user (defaults to the tunnel's user, else root)
allowWritesNoAllow a non-read statement (full-access keys only; default false)
timeoutSecondsNoMax seconds to wait (default 60, at most 300). Some chat apps stop waiting sooner — run long jobs with job_start instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / timeoutSeconds / description
      Previous value: -"Max seconds to wait (default 60). Calls longer than about 90 seconds are usually cut off by the network before they answer — run long jobs in the background instead."New value: +"Max seconds to wait (default 60, at most 300). Some chat apps stop waiting sooner — run long jobs with job_start instead."
  2. Changed1 schema field changed
    • changedInput schema / properties / timeoutSeconds / description
      Previous value: -"Max seconds to wait (default 60, up to 300)"New value: +"Max seconds to wait (default 60). Calls longer than about 90 seconds are usually cut off by the network before they answer — run long jobs in the background instead."
  3. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and readOnlyHint=false; the description is consistent with that, explaining that writes are gated behind allowWrites and full-access keys rather than contradicting it. It adds real behavioral context beyond the annotations — passwordless auth paths per engine, timeout ceiling, and SQL return format (CSV/TSV with header) — but omits row limits/truncation and failure behavior.

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?

Purpose and the passwordless mechanism are front-loaded, and nearly every clause carries information. The long em-dash parenthetical listing per-engine clients is dense but justified, since it explains why no password is needed; the size is reasonable for a 7-parameter tool.

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

Completeness4/5

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

For a cross-engine execution tool with no output schema, the description covers the auth model, read/write safety defaults, timeout limits, and SQL return shape. Remaining gaps are secondary: no statement about result size limits, partial failures, or what a non-SQL engine returns.

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

Parameters3/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, and most of the description's parameter talk (allowWrites gating, timeout default, sqlite .db path) restates what the schema already says. The one genuine addition is the MongoDB shell-expression example, which shows the expected query shape for a non-SQL engine.

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?

Opens with a specific verb+resource ("Run a database query on one of your servers") and immediately characterizes the mechanism (engine's own client over Termalin's keyless tunnel), which separates it from ssh_exec and data_tables without naming them. An agent can tell what this does and what it is not for from the first sentence.

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?

Gives clear operating conditions: read-only unless allowWrites is set and full-access keys are held, sudo vs shared-hosting behavior, and an explicit reroute for long work ("run long jobs with job_start instead"). It does not route the agent to data_schema/data_tables for discovering what to query, which is the one obvious gap.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.