Skip to main content
Glama
MCP Connect Starter

MCP Connect Starter

by cdtalley

sql_query

Run a single read-only SELECT query against the demo SQLite database to retrieve data safely. Use ? placeholders with params to pass values, keeping writes and DDL blocked.

Instructions

Run a read-only SQL query against the demo database.

Only a single SELECT or WITH...SELECT statement is allowed; writes, DDL, and multi-statement payloads are rejected before they reach SQLite. Use ? placeholders in sql and pass values via params rather than formatting them into the query text. Results are capped at MCP_CONNECT_SQL_MAX_ROWS rows (see truncated in the response).

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": "sql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
paramsNo

Output Schema

NameRequiredDescriptionDefault
rowsYes
columnsYes
row_countYes
truncatedYesTrue if more rows matched than were returned; narrow the query or paginate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does so well: it discloses the read-only enforcement, exactly which payload classes are rejected before reaching SQLite, the parameterization requirement, and a result-row cap with a `truncated` flag. It stops short of describing permissions/auth or error response shape, which keeps it from 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 core action and then the two operative constraints. Every clause (statement restriction, placeholder rule, row cap) earns its place with no filler.

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?

An output schema exists and the description appropriately avoids re-documenting return values while still flagging the one field an agent must interpret (`truncated`). Given only 2 parameters, coverage is nearly complete; the only gap is no pointer to how an agent should discover available tables before writing SQL.

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: it explains that `sql` accepts `?` placeholders and that `params` carries the bound values instead of inline formatting. That is meaningful semantics beyond the bare `sql`/`params` titles, though it doesn't state the expected ordering or types of `params` entries.

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 and resource ('Run a read-only SQL query') plus the target ('the demo database'), and the read-only qualifier immediately separates it from schema-inspection siblings like list_sql_tables. An agent knows exactly what this tool 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 Guidelines3/5

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

Usage is scoped by hard constraints (single SELECT or WITH...SELECT only, writes/DDL/multi-statement rejected) and by a strong call-time convention (use `?` placeholders with `params`). However, it never says when to prefer this over siblings such as list_sql_tables for discovering schema, nor does it state prerequisites; guidance is implied rather than explicit.

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