read_json — JSON APIs and files, shrunk
| Parameter | |
|---|---|
source | URL (HTTP GET) or local file path |
outline | Show the structure — keys, types, array sizes, one example each — instead of the data |
select | Keep only these fields (see below) |
drop_keys | Keys to remove everywhere; names or globs: ["*_url", "node_id"] |
max_items | Keep only the first N items of every array (… 480 more items) |
drop_lists_over | Replace arrays longer than N with "[480 items omitted]" |
max_str | Cut strings longer than N characters |
table | Render arrays of objects as Markdown tables |
keep_empty | Keep null, "", [], {} — by default they are dropped |
page, max_chars | As for read |
select syntax
A small, forgiving path language:
total_count a field
items.name a field of every element (arrays map implicitly)
items[0] items[-1] items[:5] index / slice
items.{name, owner.login} pick fields → {"name":…, "owner.login":…}
items.{repo: name, stars: stargazers_count} pick with aliases
total_count, items.id several fields at once
items[].tags[0] explicit [] maps everything after it (first tag of each item)
Example
read_json source=https://api.github.com/search/repositories?q=mcp outline=true
→ {total_count: number (12340), items: [30] {id: number, name: string ("github-mcp-server"), owner: {…}, …}}
read_json source=… select="items.{full_name, stargazers_count, description}" max_items=5 table=true
→ | full_name | stargazers_count | description |
|---|---|---|
| github/github-mcp-server | 32860 | GitHub's official MCP Server |
…
JSON output is compact: containers that fit on a line stay on one line; bigger ones put one element per line with one-space indentation — close to minified JSON in tokens, but still readable and pageable. API error responses (4xx/5xx) are returned shrunk, so the agent sees the error message itself.
Next: Configuration.