Skip to main content
Glama
SQL MCP Server

SQL MCP Server

by kK-2004

db_query

Query rows from an allowed database table by applying equality filters, selecting columns, ordering results, and limiting rows.

Instructions

Query rows from an allowed table.

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": {
      "table": "<table>"
    },
    "name": "db_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
tableYesTarget table name (must be allowed).
whereNoEquality conditions, e.g. {"id": 1}
columnsNoColumns to select, default ['*'].
orderByNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden and does little with it. "Allowed table" hints at an allowlist gate, but the description never states that the operation is read-only, whether a default row cap applies when limit is omitted, or what an error looks like for a disallowed table.

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

Conciseness3/5

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

The single sentence is front-loaded and free of filler, but for a five-parameter query tool with two nested-object parameters it is undersized rather than concise. Brevity here costs information rather than saving it.

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

Completeness2/5

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

With five parameters, nested where/orderBy objects, no annotations, and no output schema, the definition leaves the agent guessing about default limit behavior, ordering defaults, and the result envelope. Given the complexity, one sentence is not enough to call this correctly without trial and error.

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 60%, with table, where, and columns documented in-schema while limit and orderBy's nested fields are thinner. The description adds nothing beyond the schema — the only phrase touching a parameter, "allowed table", merely restates the table field's own description — so the 40% gap is left uncompensated, though the schema baseline keeps this at a minimum-viable 3 rather than lower.

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?

The description gives a specific verb and resource ("Query rows") plus a scope qualifier ("from an allowed table"), so an agent knows it performs a read against a permitted table rather than a write. It implicitly contrasts with db_insert/db_delete through "Query", but never names or explicitly rules out those siblings.

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

Usage Guidelines2/5

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

There is no when-to-use guidance beyond the bare verb; nothing tells the agent to prefer this over db_describe_schema for schema inspection or over db_insert for writes. No prerequisites, no exclusions, no mention of what happens when the table is not in the allowlist.

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