Skip to main content
Glama

Trim big JSON (free)

trim_json
Read-onlyIdempotent

[FREE] Shrink a JSON document for LLM context: drop null/empty values, truncate long arrays and strings (with counts), limit depth, optional key allowlist. Reports estimated tokens saved. Limit 120/hour per IP.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "json_text": "<json_text>"
    },
    "name": "trim_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
json_textYesJSON text
keep_keysNoOnly keep these keys (and the parents of them)
max_arrayNoItems kept per array, default 10
max_depthNodefault 6
max_stringNoChars kept per string, default 300

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, the description discloses exactly what is removed or truncated, that counts are preserved, that depth is limited, that an allowlist can be applied, that token savings are reported, and that there is a 120/hour per-IP rate limit. These are meaningful operational details an agent needs.

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 a single dense sentence plus a rate-limit note. It is front-loaded with the core purpose and contains no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter transformation tool with no output schema, the description gives sufficient behavioral context: inputs, transformations, token-saving report, and rate limit. The only minor gap is that the exact return shape is not described beyond the token-savings note.

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?

Schema description coverage is 100%, so the schema already documents all five parameters, including defaults. The description reinforces the transformations those parameters control but adds little syntax or default information beyond the schema.

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

Purpose5/5

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

The description gives a specific verb (shrink/trim), a specific resource (JSON document), and a clear context (LLM context), then enumerates the exact transformations performed. This is enough for an agent to distinguish it from sibling tools like compress_log or estimate_tokens.

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?

It clearly states the intended use case: shrinking JSON for LLM context. It does not explicitly say when not to use it or name alternatives, but the context is strong enough for selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources