Skip to main content
Glama

API Keg — Sheet SQL & Multi-Tab XLSX Engine

Query CSV & JSON Tables with SQLite

query_tabular_data
Read-onlyIdempotent

Ingests 1–10 named RFC 4180 CSV/TSV or JSON row-array datasets into an ephemeral zero-retention SQLite sandbox, coerces currency columns (e.g. '$1,250.50' -> 1250.5), runs read-only SQL (JOIN, GROUP BY, CTEs, window functions), and returns typed rows, Markdown preview, inferred schemas, and optional .xlsx export. Pricing: $0.002 base (up to $0.01 max $0.002 base + $0.001 per 1,000 total input rows (capped at $0.01), x402 variable settlement). Pass ?dry_run=true on REST to validate schema free.

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

Input Schema

NameRequiredDescriptionDefault
sqlYesRead-only SQLite SELECT or WITH (CTE) query supporting JOIN, GROUP BY, HAVING, and window functions (ROW_NUMBER() OVER (...), SUM, AVG).
tablesYesMap of 1 to 10 SQL table names (e.g. 'orders', 'customers') to CSV/TSV or JSON row-array payloads.
maxRowsNoMaximum result rows returned in `rows` (1–5000, default 1000).
exportXlsxNoWhen true, also exports the query result set as a styled OpenXML .xlsx workbook in `xlsxBase64`.
xlsxSheetNameNoOptional worksheet tab name when `exportXlsx` is true (default 'Query Results').
markdownPreviewRowsNoMaximum rows rendered in `markdownPreview` (1–100, default 20).
coerceCurrencyNumbersNoAutomatically strip $, €, £, ¥ symbols, thousands commas, and accounting parentheses (e.g. '$1,250.50' -> 1250.5) when an entire column is numeric.
xlsxSummaryRowFormulasNoOptional summary row formulas keyed by output column name when `exportXlsx` is true (e.g. { total_revenue: 'SUM' }).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, yet the description still adds real behavior: ephemeral zero-retention sandbox, automatic currency coercion (a data-mutating side effect), row caps, and a cost model. The pricing sentence is garbled and self-repeating ("$0.002 base (up to $0.01 max $0.002 base + $0.001 per 1,000...)"), and failure modes (invalid SQL, oversized payloads) are not described, so it falls short of 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.

Conciseness3/5

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

The capability sentence is dense yet front-loaded and earns its space. The trailing pricing clause is malformed and redundant, and the dry-run note sits awkwardly after cost detail rather than with usage guidance, so the closing third of the description reads as unedited.

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 an 8-parameter tool with a nested table map and no output schema, the description compensates well by naming the return fields (rows, markdownPreview, inferred schemas, xlsxBase64) and disclosing retention and pricing. Remaining gaps are error behavior and how the 1–10 table limits interact with the per-table size cap.

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 the schema already documents every parameter including limits and defaults. The description mentions currency coercion with the same example the schema uses and references xlsxBase64 export, but adds no new syntax, interaction, or constraint information beyond the schema — 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 specific verbs and resources: it ingests 1–10 CSV/TSV/JSON datasets into an ephemeral SQLite sandbox, runs read-only SQL, and returns typed rows, Markdown preview, inferred schemas, and optional .xlsx. The scope (1–10 tables, read-only SELECT/CTE) distinguishes it cleanly from the sibling build_xlsx_workbook, which only builds workbooks.

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 context is implied by the payload requirements and by the note about ?dry_run=true on REST for free schema validation, which is a useful pre-flight hint. It never states when to prefer this over build_xlsx_workbook, nor which situations are out of scope (e.g., writes, non-tabular data), leaving the agent to infer routing.

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.

Resources