Skip to main content
Glama

Query JSON/CSV File

json_query
Read-onlyIdempotent

Extract a slice of a local JSON or CSV file using a path query, avoiding the need to load the entire file. Returns only the matching data as JSON.

Instructions

Extract a slice of a local JSON or CSV file with a path query, instead of reading the whole file into context. CSV files are parsed using the first row as headers (every row becomes an object).

Path syntax: "." is the whole document, ".key.subkey" descends into objects, "[0]" indexes an array, "[]" maps over every element. Examples: ".users[0].name", ".items[].price", ".results[]" .

Args:

  • path (string): The .json or .csv file.

  • query (string): Path query (default "." — but prefer something narrower).

  • limit (number): If the result is an array, max elements returned (default 100).

Returns the matching slice as JSON.

Example: { "path": "~/data/users.json", "query": ".users[].email" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesJSON or CSV file path
queryNoPath query, e.g. ".users[].name".
limitNoMax array elements returned
Behavior4/5

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

Adds meaningful behavioral context beyond annotations: explains CSV parsing (first row as headers), path syntax with examples, and default query behavior. No contradiction with readOnlyHint, destructiveHint, or idempotentHint.

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?

Concise and well-structured: purpose, syntax, args with defaults, and an example. Every sentence serves a purpose with no redundancy.

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?

Complete for a query tool: explains path syntax, CSV handling, default limit, and return format (JSON slice). No output schema needed; return value is clear.

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%, but description adds value with detailed path syntax explanation (e.g., dot notation, indexing) and examples, which are not in schema. Provides practical usage guidance like 'prefer something narrower'.

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?

Clearly states it extracts a slice from local JSON/CSV files using path queries, distinguishing it from reading the whole file. Sibling tools like read_file read entire files, so purpose is well differentiated.

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?

Implicitly suggests use when only a slice is needed ('instead of reading the whole file'), but does not explicitly list when not to use or compare with alternatives like read_file.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/highercomve/mcptools'

If you have feedback or need assistance with the MCP directory API, please join our Discord server