Skip to main content
Glama

Query a table exactly

query_table
Read-only

Run an EXACT, deterministic query over ONE tabular file (a CSV, or the first table of a spreadsheet/PDF/Word document). Use this instead of ask_docs whenever the question needs COUNTING, SUMMING, AVERAGING, MIN/MAX, FILTERING, or exact row lookups over structured data ('how many rows...', 'total amount by region', 'list orders where status is failed') - semantic search undercounts tables, while this executes over EVERY row and returns exact numbers. Use ask_docs for prose/meaning questions and get_file to read a whole document. The query argument is a JSON object: { select?: [column names to return as raw rows], where?: [{col, op, value}, ...] filters combined with AND - ops eq | neq | contains compare text case-insensitively, gt | gte | lt | lte compare numerically (rows whose cell is not a number are skipped and counted in skippedNonNumeric), groupBy?: 'column' gives one result row per distinct value, aggregates?: [{fn, col}] with fn count | sum | avg | min | max ('col' required except for count), limit?: max raw rows (default 50, max 200) }. Column names match the file's header row case-insensitively. Examples: {"where":[{"col":"status","op":"eq","value":"failed"}],"aggregates":[{"fn":"count"}]} counts failed rows; {"groupBy":"region","aggregates":[{"fn":"sum","col":"amount"}]} totals amount per region; {"select":["name","email"],"where":[{"col":"country","op":"eq","value":"FR"}]} returns the matching rows. If you name a column that does not exist, the error lists the file's real columns - retry with one of those. Read-only; nothing is written, so it is safe to call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe constrained query object (grammar in the tool description): select?, where?, groupBy?, aggregates?, limit?.
fileIdYesThe id of the file to query (from list_files / search_files - the same id get_file takes).
handleNoOptional: name one of the user's OWN profiles by its public @handle (with or without the leading @), as listed by list_profiles - an alternative to projectId, and it takes precedence if both are given. Honored only for an account-wide connection; a single-project connection is already scoped and ignores it. A handle that is not one of the user's own profiles is refused outright, never quietly swapped for another profile. To read context someone ELSE shared with the user or published, use shared_context instead.
projectIdNoOptional: which of the user's projects holds the file. Honored only for an account-wide connection; a single-project connection is already scoped and ignores this.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsNoRaw matching rows (select mode). Either rows or groups is present, never both.
groupsNoAggregate rows (aggregate / groupBy mode).
columnsYes
truncatedYesTrue when rows/groups were clipped by a cap.
tableSourceYesWhether the rows came from a native CSV parse or an extracted document table.
rowCountTotalYesTotal data rows in the table.
rowCountMatchedYesRows that passed the where filter.
skippedNonNumericNoCells skipped as non-numeric during a numeric comparison or aggregate (present only when > 0).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • addedInput schema / properties / handle
      Added value: +{
      +  "description": "Optional: name one of the user's OWN profiles by its public @handle (with or without the leading @), as listed by list_profiles - an alternative to projectId, and it takes precedence if both are given. Honored only for an account-wide connection; a single-project connection is already scoped and ignores it. A handle that is not one of the user's own profiles is refused outright, never quietly swapped for another profile. To read context someone ELSE shared with the user or published, use shared_context instead.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint=true annotation, the description discloses deterministic full-scan semantics ('executes over EVERY row and returns exact numbers'), case-insensitive column and text matching, and that non-numeric cells are skipped and counted in skippedNonNumeric. It also reveals error-recovery behavior (invalid columns produce an error listing the real columns) and the default/max row limits. No contradiction with 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?

Long but dense and front-loaded: purpose and sibling routing lead, the grammar is compressed into one structured JSON sketch, and three examples illustrate real invocations. Every sentence earns its place, including the error-recovery and safety notes; the only mild redundancy is reaffirming read-only, which functions as a deliberate safety emphasis.

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?

For a tool with a nested query object, 7 operators, and 5 aggregate functions, the description covers file-format scope, full query grammar, operator semantics, limits, error behavior, and safety; the output schema covers return values, and handle/projectId semantics are thoroughly documented in the schema itself. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage the baseline is 3, but the description carries the full query grammar that the schema explicitly defers to ('grammar in the tool description'): select/where/groupBy/aggregates/limit, per-operator semantics (eq|neq|contains case-insensitive; gt|gte|lt|lte numeric), the count exemption from col, and the default 50/max 200 limit — plus three concrete examples. It adds far more meaning than the schema's stub descriptions.

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 an EXACT, deterministic query over ONE tabular file' — and names the covered formats (CSV, first table of spreadsheet/PDF/Word). It explicitly contrasts with ask_docs ('semantic search undercounts tables') and get_file, so an agent can distinguish it from siblings 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 Guidelines5/5

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

Gives explicit when-to-use conditions: use it instead of ask_docs whenever the question needs COUNTING, SUMMING, AVERAGING, MIN/MAX, FILTERING, or exact row lookups, with concrete example phrasings ('how many rows...', 'total amount by region'). It also states what the alternatives are for — 'Use ask_docs for prose/meaning questions and get_file to read a whole document' — leaving nothing to inference.

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.

TDQS

A4.4/5.0
Disambiguation3/5

Most tools have clear boundaries, but fetch/get_file and search/search_files are explicit aliases of each other, creating redundant purposes. account vs info and list_files vs search_files also require careful reading to tell apart, though the descriptions do provide guidance.

Naming Consistency3/5

The set mixes verb_noun names (list_files, query_table, suggest_update) with standalone nouns (account, info, profile) and bare verbs (fetch, search). The naming is readable and lowercase throughout, but the conventions are not uniform.

Tool Count5/5

Thirteen tools is a reasonable, well-scoped number for a personal-context and document-access server. The two alias pairs add some redundancy but do not make the set feel bloated.

Completeness4/5

The server covers the core read-only workflows: discovering files, searching semantically, querying tabular data, retrieving full documents, reading profiles, and accessing shared context. Direct profile editing or file mutations are intentionally out of scope for this read-only connection, and suggest_update provides the one sanctioned write path.