Skip to main content
Glama

US Economic, SEC EDGAR & On-Chain Data (x402)

Structured JSON Repair

structured_json_repair
Read-onlyIdempotent

Repair messy or invalid JSON (the kind LLMs and tools often emit) into clean, valid JSON, and optionally validate/coerce it against a JSON Schema. Pure deterministic compute — no network or model calls.

What it fixes: trailing commas, single-quoted strings, unquoted keys, Python literals (None/True/False), NaN/Infinity, Markdown code-fence wrappers, and truncated/garbled tails.

When to use: you received text that should be JSON but JSON.parse fails, or you have JSON that must conform to a specific schema and want types coerced (e.g. "36" -> 36, "true" -> true).

When NOT to use: the input is already known-valid JSON and no schema check is needed.

Args:

  • input (string, required): the raw/malformed JSON text.

  • schema (object, optional): a JSON Schema (draft 2020-12) to validate and coerce against.

  • coerce (boolean, optional, default true): coerce primitive types to satisfy the schema before validating.

Returns structuredContent: { "ok": boolean, // true if valid JSON (and schema-valid when a schema was given) "data": any, // the repaired/validated JSON value; null if unfixable "changed": boolean, // true if any repair or coercion modified the input "errors": string[], // actionable messages when ok is false "repairs": string[] // description of each fix applied }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesRaw or malformed JSON text to repair. Examples: "{name: 'Ada', age: '36',}", a ```json fenced block, or a truncated '{"items":[1,2,3'.
coerceNoWhen true (default), coerce primitives to satisfy the schema before validating (e.g. "36" -> 36).
schemaNoOptional JSON Schema (draft 2020-12) object to validate and coerce the repaired JSON against.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesTrue if the result is valid JSON (and schema-valid when a schema was provided).
dataNoThe repaired/validated JSON value (object, array, or primitive). null when repair failed.
errorsYesActionable error messages when ok is false (empty when ok is true).
changedYesTrue if any repair or coercion changed the input.
repairsYesHuman-readable description of each repair or coercion applied.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, and non-destructive behavior. The description adds meaningful behavioral context: pure deterministic compute with no network/model calls, the specific repairs performed, and the complete return structure including errors and repairs. This goes well beyond the annotations and is fully consistent.

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 well-structured with clear sections: main purpose, list of fixes, usage conditions, arguments, and return schema. Every section adds necessary information with no filler, and the front-loaded purpose statement is immediately actionable.

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

Completeness5/5

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

Given three parameters, full schema coverage, and strong annotations, the description is remarkably complete. It explains the return value in detail, the boundaries of what it can fix, and the deterministic nature of the operation. There are no apparent gaps for an agent to select and invoke this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description reinforces the parameters with concrete coercion examples ('36' -> 36, 'true' -> true) and clarifies the schema draft version. While it largely restates the schema, the examples add practical meaning for the coerce parameter, earning a slight bonus.

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 ('repair') and resource ('messy or invalid JSON') and clearly states the optional schema validation/coercion. It distinguishes itself from sibling tools like tabular_to_json by focusing on repair rather than conversion, and explicitly enumerates the types of malformations it addresses.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'When to use' and 'When NOT to use' sections with concrete conditions (JSON.parse fails, schema coercion needed, already-valid JSON not needing checks). This exceeds the 'clear context' bar and includes exclusions, fully guiding an agent on when to select this tool over alternatives.

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.

TDQS

A4.5/5.0
Disambiguation5/5

Every tool targets a distinct resource and action. The macro_* tools each cover one economic indicator, the edgar_* tools cover different SEC filing types, and the onchain_* tools are split by chain scope (single vs multi), asset type, and operation. Even the two data-cleaning tools are clearly distinct (JSON repair vs table parsing). No two tools appear to do the same thing.

Naming Consistency4/5

Names follow a mostly consistent snake_case pattern with domain prefixes: macro_*, edgar_*, onchain_*. The exceptions are bls_cpi (could be macro_cpi) and the utility tools structured_json_repair and tabular_to_json, which break the prefix pattern but are still descriptive and predictable. Overall, the convention is clear with minor deviations.

Tool Count3/5

21 tools is in the 'heavy' range (16-25). However, the server spans three distinct domains (US economic data, SEC EDGAR, on-chain data), and each tool serves a unique purpose within its domain. While it feels dense, the breadth is justified by the server's stated multi-domain scope.

Completeness4/5

The tool surface covers the major needs in each domain: key macro indicators, common EDGAR filings and searches, and core on-chain reads. Minor gaps exist (e.g., no PPI, no historical on-chain balances, no company CIK lookup), but agents can work around these with existing tools or by combining them.