Skip to main content
Glama

Run SQL against a sheet

napkin_sheets_query
Read-only

Runs a SQLite SELECT over a sheet's tabs-as-tables (get the table/column names from napkin_sheets_schema first). Full SQLite dialect: WHERE, GROUP BY, ORDER BY, JOINs across tabs, aggregates. Results cap at 200 rows. This is THE way to answer questions about a sheet's data — never eyeball cells when a query can answer precisely.

Input Schema

NameRequiredDescriptionDefault
sqlYesA single SELECT.
sheetIdYesSheet id from napkin_sheets_list.
workspaceNoWorkspace slug. Personal tokens with no default workspace MUST pass this; tokens with a default can override per call. Ignored for workspace API keys.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/destructiveHint=false, so safety is covered; the description adds two behavioral facts the structured data does not: the 200-row result cap and the supported SQL surface. It does not say what happens to non-SELECT input or where the cap is enforced (truncation vs error), which keeps it out of 5 territory.

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

Conciseness4/5

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

Three sentences, front-loaded with the action and resource, then the prerequisite in parentheses, then the dialect and cap, then the usage directive. Nothing is redundant, though the emphatic 'This is THE way' phrasing is slightly promotional for the informational payload it carries.

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 3-parameter read-only tool with no output schema and full schema coverage, the essentials are present: prerequisite tool, dialect, row cap, and when to use it. The only gap is that nothing describes the shape of the returned result set beyond its row ceiling.

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 coverage is 100%, so the baseline is 3; the description exceeds it by explaining what 'sql' can actually contain (JOINs across tabs, aggregates, GROUP BY/ORDER BY) and by clarifying the tabs-as-tables mental model that makes 'sheetId' meaningful. It still leaves the 5000-char limit and the 'single SELECT' constraint to the schema.

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?

The description names a specific verb (runs a SQLite SELECT) and resource (a sheet's tabs-as-tables), and immediately bounds the scope with 'Full SQLite dialect: WHERE, GROUP BY, ORDER BY, JOINs across tabs, aggregates.' An agent can distinguish it from napkin_sheets_set_cells (write) or napkin_tables_query (a different resource) without opening any 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?

It gives an explicit prerequisite and ordering ('get the table/column names from napkin_sheets_schema first') plus a clear directive on when to prefer querying over reading cells ('never eyeball cells when a query can answer precisely'). It stops short of naming the exclusion case explicitly — e.g., distinguishing it from napkin_tables_query for non-sheet data — so it is strong context rather than fully exhaustive 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