Skip to main content
Glama

json schema infer

json_schema_infer
Read-only

Infer a JSON Schema (draft 2020-12) and a TypeScript type from example JSON: nested objects and arrays, union types, required fields (present in every sample), enums for low-cardinality strings, string formats (date, date-time, email, uri, uuid), min/max for numbers and string lengths. Up to 3 MB / 5,000 samples. $0.003. Costs $0.003 USDC per call (x402).

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": {
      "samples": "<samples>"
    },
    "name": "json_schema_infer"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleNo
strictNofalse drops required
samplesYesarray of example objects (or one object)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, and the description adds real context beyond them: hard limits (3 MB / 5,000 samples) and a payment requirement ('$0.003 USDC per call (x402)'), which is critical since the call is not free. It omits failure behavior for malformed or empty samples, so it stops short of a 5.

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

Conciseness4/5

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

Purpose and capabilities are front-loaded in one dense sentence, followed by short constraint/cost fragments. The one clear waste is the duplicated pricing ('$0.003. Costs $0.003 USDC per call (x402).'), which costs it a point.

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?

With no output schema, the description usefully enumerates the shape of the returned artifacts (nested objects/arrays, unions, enums, formats, min/max) and covers limits plus cost. For a 3-parameter, read-only, single-purpose tool this is nearly complete; only error/edge-case behavior is missing.

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 coverage is 67%; the schema describes 'strict' and 'samples' but leaves 'title' bare. The description contributes the size/sample-count constraints that govern 'samples' and clarifies that 'required' means 'present in every sample', but it says nothing about the 'title' parameter or how 'strict' interacts with inference, so it only partially compensates.

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?

States a specific verb ('Infer') plus two concrete resources ('a JSON Schema (draft 2020-12) and a TypeScript type from example JSON'), and enumerates what the inference covers (unions, required fields, enums, formats, min/max). The operation is unmistakable and distinct from validate/repair/diff siblings, but no sibling is named to explicitly route the agent.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no named alternative (json_validate, json_repair, sql_generate), and no exclusion conditions. The only framing is 'from example JSON', which merely restates the purpose rather than telling the agent when this tool beats a sibling.

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