Skip to main content
Glama

query_data

Read-only

Read-only SQL (SQLite) over tables saved with store_as: SELECT or WITH, plus SHOW TABLES and DESCRIBE . Returns at most 200 rows. Nested fields are flattened with _ (trend.direction -> trend_direction); booleans are 1/0. Tables are kept per API key and deleted 24 h after last use; format=csv returns CSV text.

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

Input Schema

NameRequiredDescriptionDefault
sqlYesOne statement.
formatNocsv: rows as CSV text. Default json.
max_rowsNoDefault 200.

Output Schema

NameRequiredDescriptionDefault
dataNoThe tool's result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds material context on top: a 200-row cap, nested-field flattening with underscores, booleans rendered as 1/0, per-API-key table isolation, and 24-hour deletion after last use. Those are exactly the behaviors an agent needs and none are in the annotations.

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 dense sentences, front-loaded with the capability and constraints, with no filler. Every clause (allowed statements, row cap, flattening, table lifecycle) conveys operational information.

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

Completeness5/5

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

A 3-parameter tool with an output schema and full annotation coverage needs little more, and the description still supplies the lifecycle and data-shaping details that determine whether results are usable. Nothing required to call it correctly 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?

Schema description coverage is 100%, so sql, format, and max_rows are already documented, and the description mostly restates them (format=csv returns CSV text, 200-row limit). It adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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 (read-only SQLite SQL over tables created via store_as) and bounds the allowed statement set to SELECT/WITH plus SHOW TABLES and DESCRIBE <table>. That scope is distinct enough from siblings like get_schema or get_ohlcv that an agent can pick it 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 Guidelines4/5

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

Implies the use case clearly: query tables previously saved with store_as, and only via read statements. It does not explicitly say when to prefer this over sibling data tools such as get_ohlcv or get_market, so it stops short of full when/when-not guidance.

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.