Skip to main content
Glama
MCP Database Server

MCP Database Server

by saadrupai

run_query

Execute read-only SQL SELECT/WITH queries against a SQLite database to answer business questions, with results capped at 200 rows.

Instructions

Run a READ-ONLY SQL query (SQLite dialect). Only SELECT/WITH. Results are capped at 200 rows. Money columns ending in _cents are integers in cents.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.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 most important traits: read-only enforcement, SELECT/WITH restriction, a hard 200-row cap, and the _cents integer convention. It omits other behavior an agent might want, such as error/rollback behavior on rejected statements, statement timeout, or whether all tables are accessible.

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?

Four short, front-loaded sentences with no filler; the hard constraint (read-only) comes first, followed by limits and data-format caveats. Every sentence earns its place.

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 single-parameter query tool with no output schema, the description covers the essentials needed to call it correctly: dialect, allowed statement types, result cap, and unit semantics for money columns. Minor gaps remain around multi-statement handling and error behavior, but nothing critical is missing.

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?

The single parameter has 0% schema description coverage, so the description must compensate -- and it partly does by naming the dialect and restricting statements to SELECT/WITH. It still adds no detail about whether the sql string can contain multiple statements, bind parameters, or how quoting/table qualification works, so it is only partial compensation.

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 a READ-ONLY SQL query') plus dialect (SQLite), which clearly sets it apart from a table-listing or summary tool in practice. It stops short of explicitly contrasting itself with the siblings (describe_table, list_tables, sales_summary), so it lands at 4 rather than 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?

'Only SELECT/WITH' functions as a when-not constraint on what queries are valid, which is useful. However, there is no guidance on when to reach for this ad-hoc query tool versus sales_summary or list_tables, leaving the choice to inference.

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