---
schema: 1
type: term
title: _JQ filter_
description: >-
  A **_JQ filter_** is a query applied to JSON to trim a response down to only
  what the model needs — in this channel's material, a technique Alex Rattray
  recommends for MCP servers so tool responses don't waste context tokens
  [^913c216d-5ccb-51d9-8f42-8feb7c017d9d@1346].
canonical: 'https://liquidgold.cc/channel/everyinc/explore/term/jq-filter-41f1934260cc'
markdown: 'https://liquidgold.cc/channel/everyinc/explore/term/jq-filter-41f1934260cc.md'
llms: null
parent: 'https://liquidgold.cc/channel/everyinc/llms.txt'
channel: everyinc
updated: '2026-10-23T22:12:35.346Z'
language: null
children: []
---


# \_JQ filter\_

Canonical: https://liquidgold.cc/channel/everyinc/explore/term/jq-filter-41f1934260cc

Parent: [Channel index](https://liquidgold.cc/channel/everyinc/llms.txt)

## Definition

A **_JQ filter_** is a query applied to JSON to trim a response down to only what the model needs — in this channel's material, a technique Alex Rattray recommends for MCP servers so tool responses don't waste context tokens [^913c216d-5ccb-51d9-8f42-8feb7c017d9d@1346].

## 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.  [^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.
