Skip to main content
Glama

data_query

Read-onlyIdempotent

Query JSON, YAML, or TOML files with yq expressions to extract specific data, filter content, or transform structure without modifying the file.

Instructions

Extract specific data, filter content, or transform structure without modification.

Use when you need to extract specific data, filter content, or transform the structure of a JSON, YAML, or TOML file without modifying it.

Output contract: Returns {"success": bool, "result": Any, "format": str, "file": str, ...}. Side effects: None (read-only). Failure modes: FileNotFoundError if file missing. ToolError if format disabled or query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor from previous response (omit for first page)
file_pathYesPath to file
expressionYesyq expression to evaluate (e.g., '.name', '.items[]', '.data.users')
output_formatNoOutput format (defaults to same as input file format)
document_indexNoOptional YAML document index for multi-document files (0-based)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
formatNo
resultNo
successYes
advisoryNo
paginatedNo
nextCursorNo
schema_infoNo
structure_summaryNo
Behavior5/5

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

Beyond annotations (readOnlyHint, idempotentHint, destructiveHint), the description adds output contract format, confirms no side effects, and lists failure modes (FileNotFoundError, ToolError). 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?

The description is concise with three clear sections: purpose, usage, and contract/behavior. Every sentence adds value, no fluff. Front-loaded with primary purpose.

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?

Given the tool's complexity (5 params, 2 required, output schema present), the description fully covers purpose, usage, output contract, side effects, and failure modes. No gaps remain.

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% with detailed parameter descriptions. The description does not add significant meaning beyond the schema (e.g., mentions 'yq expression' and supported formats). 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?

The description clearly states the tool extracts, filters, or transforms data without modification, using a specific verb and resource. It distinguishes from siblings like data_convert or data_merge by emphasizing read-only querying on JSON, YAML, TOML files.

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?

The description explicitly states when to use the tool (extracting/filtering/transforming without modification) and provides output contract and failure modes. It lacks explicit when-not-to-use or alternative tools, but the context is clear.

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/bitflight-devops/mcp-json-yaml-toml'

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