Skip to main content
Glama
micaelmalta

Fetch MCP Server

by micaelmalta

optimize_json

Read-onlyIdempotent

Reduce token usage by optimizing JSON payloads: extract specific fields via JSONPath, limit output size, and flatten deep nesting.

Instructions

Optimize any JSON payload to reduce token usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesRaw JSON string to optimize, OR a file path to a JSON file. When an MCP tool response is too large and gets saved to a file, pass the file path here (e.g. '/path/to/tool-results/file.txt').
jsonpathNoJSONPath expression to extract specific fields (e.g. '$[*].name', '$[?@.state=="open"]')
max_charsNoMaximum characters in output
max_depthNoMax nesting depth before flattening (default 5)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds no extra behavioral context such as side effects, permissions, or result format, but does not contradict annotations.

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, front-loaded sentence with no wasted words, making it highly concise and structured.

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?

The combination of a clear one-sentence description and a fully documented schema with an output schema provides sufficient information for an agent to invoke the tool. However, it could benefit from a note about file path handling, though that is already in the schema.

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?

All four parameters are fully described in the schema with 100% coverage, so the description adds no additional parameter semantics. The schema's parameter descriptions carry the full burden.

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 uses a specific verb ('Optimize') with a clear resource ('any JSON payload') and purpose ('reduce token usage'), effectively distinguishing it from the sibling fetch/search tools.

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?

The description implies usage for reducing token consumption of JSON payloads, but it does not explicitly state when to use it vs alternatives or any exclusions. Given unrelated siblings, the context is clear but not exhaustive.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/micaelmalta/fetch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server