Skip to main content
Glama

JSON schema from example: infer a JSON Schema

json_schema
Read-only

Infer a JSON Schema (draft 2020-12) from an example JSON value: types, nested object properties, required keys, array item shapes merged across all items, and string formats (date-time, date, email, uri, uuid). Use to document an API response or to validate later data against the same shape. Example: json={"id":1,"email":"ada@example.com","tags":["a","b"],"created":"2026-10-23T08:00:00Z"}. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
jsonYesThe example JSON

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 and non-destructive annotations, it discloses that each call is charged, repeats are not free, the first 25 calls are free, failed calls are free, and payment is via x402 USDC or a card key. It also explains what the output contains, including draft version and supported inference features.

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?

The definition is front-loaded with the core action and inferred output, followed by usage, an example, and billing details. It is somewhat dense because it packs pricing and behavioral notes into the same paragraph, but every sentence carries useful information.

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?

For a simple one-parameter tool with no output schema, the description covers purpose, output format, usage context, an example input, and billing behavior. An agent has enough information to decide when to call it and what to expect.

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?

The schema has one parameter with 100% description coverage, so the baseline is 3. The description supplies an example value for the json parameter, which clarifies expected input shape, but it does not add substantial syntax or formatting details beyond that example.

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 states a specific verb and resource: infer a JSON Schema from an example JSON value. It names the schema draft, the inferred constructs, and distinguishes itself from sibling tools like json_validate and json_format by focusing on schema generation rather than validation or formatting.

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 gives clear use cases: documenting an API response or validating later data against the same shape. It does not explicitly state when not to use it or name alternatives such as json_validate, but the intended context is easy to infer.

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.