Skip to main content
Glama
Safe SQL MCP

Safe SQL MCP

by korolserhii

run_query

Execute a single read-only SELECT query against a SQLite database to answer business questions, returning columns and rows as JSON within configured row limits.

Instructions

Run ONE read-only SELECT query (SQLite). purpose: the user's question in a few words, kept in the audit log. Returns columns and rows as JSON, at most the configured row limit.

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": {
      "sql": "<sql>"
    },
    "name": "run_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
purposeNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/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 disclose the key traits: execution is read-only, a single statement only, the dialect is SQLite, and results are truncated at a configured row limit. It omits error behavior, permission requirements, and whether the limit is surfaced in the response, which keeps it below a 5.

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

Conciseness5/5

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

Three short sentences, front-loaded with the operative constraint ('Run ONE read-only SELECT query'), then the audit-log note, then the return contract. No redundancy or filler.

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

Completeness3/5

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

The return format is covered by the output schema and briefly echoed here, and the read-only/row-limit constraints are stated, so the core contract is present. What is missing for a SQL tool is guidance on discovering tables and columns before writing a query, which is the most common way an agent fails with this tool.

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 description coverage is 0%, so the description must compensate, and it does: 'sql' is constrained to a single read-only SELECT in SQLite, and 'purpose' is defined as a short phrase of the user's question that persists in the audit log, which explains why an otherwise mysterious string is worth filling in. Only the 'sql' semantics are conveyed indirectly rather than explicitly.

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

Purpose4/5

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

States a specific verb and resource ('Run ONE read-only SELECT query') plus the engine ('SQLite') and the output shape, which is enough for an agent to know this is the SQL execution path. It does not name or differentiate itself from the siblings get_metric or list_tables, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: 'ONE read-only SELECT' implicitly excludes multi-statement scripts and any DML, but the description never says when to prefer this over get_metric or list_tables, nor does it suggest inspecting the schema first. The agent must infer the workflow.

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

Deploy Server

Other Tools