Skip to main content
Glama

data_query

Read-only

Extract, filter, or transform data from JSON, YAML, or TOML files using yq expressions for targeted data retrieval without modifying original files.

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
file_pathYesPath to file
expressionYesyq expression to evaluate (e.g., '.name', '.items[]', '.data.users')
output_formatNoOutput format (defaults to same as input file format)
cursorNoPagination cursor from previous response (omit for first page)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description adds valuable behavioral context beyond the readOnlyHint annotation. It explicitly states 'Side effects: None (read-only)' and details failure modes like 'FileNotFoundError if file missing' and 'ToolError if format disabled or query fails.' It also specifies the output contract format, which provides transparency about return values. This goes well beyond what the annotation alone provides.

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 perfectly structured and concise. It starts with the core purpose, then provides usage guidelines, output contract, side effects, and failure modes—all in clear, separate statements with zero wasted words. Every sentence adds essential information.

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 (query operations on multiple file formats), the description provides excellent completeness. It covers purpose, usage context, behavioral traits, output format, and failure modes. With both annotations (readOnlyHint) and an output schema available, the description doesn't need to repeat structured information but adds valuable contextual details that make the tool's behavior fully transparent.

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?

With 100% schema description coverage, the input schema already documents all parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline score of 3 is appropriate since the schema carries the full parameter documentation burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Extract specific data, filter content, or transform structure without modification.' It specifies the verb (extract/filter/transform) and resource (JSON/YAML/TOML files). However, it doesn't explicitly differentiate from sibling tools like data_convert or data_merge, which likely handle similar file operations.

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 provides clear context: 'Use when you need to extract specific data, filter content, or transform the structure of a JSON, YAML, or TOML file without modifying it.' This gives explicit when-to-use guidance. It doesn't mention when not to use it or name specific alternatives among siblings, but the context is sufficiently clear for an agent to understand the appropriate use case.

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