Skip to main content
Glama

Query CSV

csv_query
Read-only

Free, read-only. Query a comma-separated CSV with a header row, from a URL (max 5 MB, streamed) or inline text, one of the two: select columns, filter rows, sort, limit. Returns {meta:{returned_rows,columns,total_rows,truncated},rows:[{column:value}]}, all values strings, or CSV text with format='csv'. One filter condition, no joins or aggregates. Unknown select columns and bad filters error with the valid names or operators. Over 5 MB: csv_query_xl (paid, 100 MB).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "csv_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
csvNoInline CSV text. Not with url.
urlNoCSV URL, max 5 MB. Not with csv.
limitNoRows to return. Default 500, max 5000; over it meta.truncated=true.
filterNo'column op value'. Ops: = != contains startswith endswith (text, case-insensitive), > >= < <= (numeric). E.g. 'age >= 30'.
formatNojson (default): {meta,rows}. csv: text with header row.
selectNoColumns to keep, comma-separated, exact header names. Omit for all.
headersNoHeaders to forward (Authorization, Cookie…).
sort_byNoColumn to sort by; numeric when values parse as numbers, else text.
sort_dirNoasc (default) or desc.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / csv / description
      Previous value: -"Raw CSV (alt. to url)."New value: +"Inline CSV text. Not with url."
    • changedInput schema / properties / filter / description
      Previous value: -"'col op value'."New value: +"'column op value'. Ops: = != contains startswith endswith (text, case-insensitive), > >= < <= (numeric). E.g. 'age >= 30'."
    • changedInput schema / properties / format / description
      Previous value: -"Default json."New value: +"json (default): {meta,rows}. csv: text with header row."
    • changedInput schema / properties / limit / description
      Previous value: -"Default 500, max 5000."New value: +"Rows to return. Default 500, max 5000; over it meta.truncated=true."
    • changedInput schema / properties / select / description
      Previous value: -"Columns, comma-separated."New value: +"Columns to keep, comma-separated, exact header names. Omit for all."
    • changedInput schema / properties / sort_by / description
      Previous value: -"Sort column."New value: +"Column to sort by; numeric when values parse as numbers, else text."
    • changedInput schema / properties / sort_dir / description
      Previous value: -"Default asc."New value: +"asc (default) or desc."
    • changedInput schema / properties / url / description
      Previous value: -"CSV URL (alt. to csv)."New value: +"CSV URL, max 5 MB. Not with csv."
  2. Changed8 schema fields changed
    • addedInput schema / properties / csv / description
      Added value: +"Raw CSV (alt. to url)."
    • addedInput schema / properties / format / description
      Added value: +"Default json."
    • addedInput schema / properties / headers / description
      Added value: +"Headers to forward (Authorization, Cookie…)."
    • addedInput schema / properties / limit / description
      Added value: +"Default 500, max 5000."
    • addedInput schema / properties / select / description
      Added value: +"Columns, comma-separated."
    • addedInput schema / properties / sort_by / description
      Added value: +"Sort column."
    • addedInput schema / properties / sort_dir / description
      Added value: +"Default asc."
    • addedInput schema / properties / url / description
      Added value: +"CSV URL (alt. to csv)."
  3. Changed1 schema field changed
    • addedInput schema / properties / headers
      Added value: +{
      +  "type": "object"
      +}
  4. Changed2 schema fields changed
    • removedInput schema / properties / csv / description
      Removed value: -"Alt. to url: raw CSV text to query. Provide this OR url, not both."
    • removedInput schema / properties / url / description
      Removed value: -"URL of a CSV to fetch (http:// or https://). Provide this OR csv, not both."
  5. Changed2 schema fields changed
    • addedInput schema / properties / csv / description
      Added value: +"Alt. to url: raw CSV text to query. Provide this OR url, not both."
    • addedInput schema / properties / url / description
      Added value: +"URL of a CSV to fetch (http:// or https://). Provide this OR csv, not both."
  6. Changed8 schema fields changed
    • removedInput schema / properties / csv / description
      Removed value: -"Raw CSV text (alternative to url)."
    • changedInput schema / properties / filter / description
      Previous value: -"Row filter expression: 'column op value'. Operators: = != > >= < <= contains startswith endswith. E.g. 'age > 30' or 'country = US'."New value: +"'col op value'."
    • removedInput schema / properties / format / description
      Removed value: -"Output format: 'json' (default) or 'csv'."
    • removedInput schema / properties / limit / description
      Removed value: -"Maximum number of rows to return (default 500, max 5000)."
    • removedInput schema / properties / select / description
      Removed value: -"Comma-separated column names to include (e.g. 'name,age,country'). Omit to include all columns."
    • removedInput schema / properties / sort_by / description
      Removed value: -"Column name to sort by."
    • removedInput schema / properties / sort_dir / description
      Removed value: -"Sort direction: 'asc' (default) or 'desc'."
    • removedInput schema / properties / url / description
      Removed value: -"URL of the CSV file to fetch (http/https)."
  7. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true; the description goes well beyond by disclosing the 5 MB streamed cap, the default/max limit and the truncation flag, that all values are returned as strings, and that unknown select columns or bad filters produce errors listing valid names/operators. It also describes the return payload shape even though no output schema exists. It stops short of stating pagination or auth behavior for the forwarded headers, so not a full 5.

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?

Front-loaded with the safety/size framing, then source modes, then capabilities, then return shape, then constraints, then the escape hatch to the paid sibling. Dense but every clause carries distinct information; no filler.

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?

With nine optional parameters, no output schema, and a nested headers object, the description still covers source modes, limits, error behavior, return structure and the upgrade path. 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.

Parameters3/5

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

Schema coverage is 100%, so every parameter already carries its own description including the filter operator list and enum values. The description largely restates these (mutual exclusivity of csv/url, limit behavior, filter restrictions) rather than adding syntax or edge-case guidance the schema lacks. Baseline 3 is appropriate.

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 (query) and resource (CSV with a header row) plus the exact operations available: select, filter, sort, limit. It also distinguishes itself from the paid sibling csv_query_xl and implicitly from json_query by naming the CSV format constraint.

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 source exclusivity ("one of the two": url or inline csv), explicit scope limits (one filter condition, no joins or aggregates), and a named alternative with its trigger condition and trade-off (over 5 MB → csv_query_xl, paid, 100 MB). The agent knows both when to use this and when to switch.

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.