Skip to main content
Glama

WritersLogic verifiable AI agents

schema-repair

Repair a JSON value toward a schema using only the coercions the caller declares — Validates a JSON value against a caller-supplied JSON Schema 2020-12 and applies only the coercions you list (for example string-to-integer for "42", trim-strings, enum-case, apply-defaults, drop-additional) when each one strictly reduces the number of schema errors. Every change is returned with its JSON pointer, the rule, the old and new value; every error that remains is returned with its exact

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": {
      "schema": "<schema>",
      "value": "<value>",
      "coercions": "<coercions>"
    },
    "name": "schema-repair"
  }
}

Input Schema

NameRequiredDescriptionDefault
valueYesThe JSON value to repair.
schemaYesThe schema the value must satisfy. Full JSON Schema 2020-12 (local $ref only).
coercionsYesCoercions you allow. Empty means validate only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

With zero annotations the description carries the full burden and does well: it discloses the conservative safety rule (a coercion fires only if it strictly reduces error count), that scope is limited to caller-listed coercions, and that all mutations are reported with JSON pointer, rule, and old/new values. Gaps remain on idempotency, whether the input is mutated in place, and limits such as local-$ref-only schemas, which appear only in the schema text.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening clause is front-loaded and efficiently captures the core contract, and the middle sentence carries real information about change reporting. However the text ends mid-sentence ('with its exact'), so the structure is visibly truncated and the final clause dangles without resolution.

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

Completeness3/5

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

There is no output schema, so the description must define the return contract; it does so partially (list of changes with pointer/rule/old/new, plus remaining errors) but the sentence describing the error output is cut off, leaving an agent unsure of the exact error shape. For a 3-required-parameter repair tool with no annotations, this is adequate but leaves a known hole.

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 baseline is 3; the description earns an extra point by adding meaning beyond the enum list – it exemplifies coercion semantics ('string-to-integer for "42"', trim-strings, enum-case, apply-defaults, drop-additional) and states the conditional under which any listed coercion actually takes effect. The parameters themselves (value/schema/coercions) are not separately re-explained, which is acceptable given the schema.

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

Purpose4/5

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

Specific verb+resource: 'Repair a JSON value toward a schema', plus the precise mechanism (apply only caller-declared coercions when each strictly reduces schema errors). It is distinguishable in substance from validation siblings like schema-compat/schema-witness, but it never names or contrasts them, so an agent must infer the split.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the tool is for fixing schema violations, and the gating rule ('only when each one strictly reduces the number of schema errors') tells when a coercion is applied. There is no explicit when-to-use/when-not guidance, no direction to validate-only (that conditional lives only in the schema field description), and no comparison to alternative tools.

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