JQ filter
How the channel uses JQ filter
## Where JQ filter appears In the channel's material on MCP server design, a JQ filter shows up as one of Alex Rattray's recurring rules for building MCP servers well. The rule: return only what the model needs, using a JQ filter to trim JSON responses before they land in the model's context window. [moment: 1346] [^913c216d-5ccb-51d9-8f42-8feb7c017d9d@1346] [^ea9761fa-0184-555e-be30-4928a6682680@1346] ## Why it matters in context The rule sits alongside Rattray's other design principles for MCP tools: - keep the number of tools small - make tool names and descriptions precise and specific - keep few, concisely-described parameters in the input schema - return only what the model needs, using a JQ filter to trim JSON responses [^913c216d-5ccb-51d9-8f42-8feb7c017d9d@1346] The reasoning is the channel's context-window problem: big APIs translated one-to-one into MCP tools burn hundreds of thousands of tokens of context before any real work starts [^913c216d-5ccb-51d9-8f42-8feb7c017d9d@871] [^ea9761fa-0184-555e-be30-4928a6682680@919] — and bloated JSON responses continue that waste at tool-call time. A JQ filter is the practical lever for trimming that response payload. - A JQ filter trims JSON returned by an MCP tool so only what the model needs enters the context. - It is one of Rattray's stated rules for MCP server design, alongside few tools, precise descriptions, and small input schemas. - The underlying motivation is context cost: oversized tool responses waste the model's limited context budget.