Skip to main content
Glama

jq JSON processor

jq
Read-only

Query and transform JSON from a file path or raw string using filter expressions, returning compact structured output instead of reading entire files.

Instructions

Query and transform JSON using jq expressions. Accepts a file path or raw JSON string. Returns parsed, structured output — far more compact than reading a full JSON file. The filter is passed directly to jq (no shell), so shell-style escaping such as backslash-escaped quotes is neither needed nor supported — write the filter exactly as jq expects it.

Input Schema

NameRequiredDescriptionDefault
fileNoPath to a JSON file
inputNoRaw JSON string to process (alternative to file)
slurpNoRead entire input into array (-s)
filterNojq filter expression (default: '.').
compactNoCompact output (-c)
rawOutputNoOutput raw strings without JSON encoding (-r)

Output Schema

NameRequiredDescriptionDefault
resultYes
retainedNo
multilineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish a read-only safety profile, and the description adds genuinely non-obvious behavior: the filter is passed directly to jq with no shell, so backslash escaping is neither needed nor supported, plus a note on output form. Error behavior on malformed filters is not covered, keeping it at 4.

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?

Four short sentences, front-loaded with purpose then input forms then the escaping caveat. No filler; every sentence carries actionable 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?

Six parameters are fully documented in the schema and an output schema exists, so return values need no prose. The description fills the remaining gap an agent would actually stumble on: filter escaping.

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%, so the baseline is 3; the description goes beyond it by explaining the file-vs-raw-JSON input choice and how the filter string must be written literally (no shell escaping). Flags like slurp/compact/rawOutput are left entirely to the schema.

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?

States a specific verb and resource ('Query and transform JSON using jq expressions') and clarifies accepted input forms. It does not explicitly name siblings like yq (YAML) or cat, so differentiation is implied rather than stated.

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?

Provides clear context for when to reach for it: 'far more compact than reading a full JSON file', which implicitly steers the agent away from cat/ls-style reads. No explicit exclusions or named alternatives are given.

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