Skip to main content
Glama

infer_schema

Infer a JSON Schema (draft 2020-12) from an example JSON value. Free and deterministic. Set as_samples=true when the input is an array of example objects of the same shape to merge them into one schema. Turns sample agent/tool output into a reusable schema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesA JSON value (or array of samples) to infer a schema from
as_samplesNoTreat a top-level array as multiple samples of one shape

Schema Changelog

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

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

No annotations provided, but description covers key behaviors: free, deterministic, and explains how as_samples merges multiple samples. Lacks details on output format or errors, but adequate for the tool's simplicity.

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?

Two sentences, no redundancy. First sentence defines core purpose, second sentence adds crucial parameter guidance and a real-world use case. Efficient and impactful.

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 no output schema and simple parameters, the description fully covers what the agent needs to know to use the tool correctly, including the key as_samples nuance.

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 covers both parameters with descriptions. The description adds value by explaining when to set as_samples=true, which is not obvious from the schema alone.

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 clearly states the tool infers a JSON Schema from an example value, using specific verb and resource. It distinguishes from siblings like extract_json and repair_json by noting it is free, deterministic, and turns sample output into reusable schema.

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?

Provides explicit guidance for using the as_samples parameter when input is an array of same-shape objects. Does not directly compare with alternatives, but the context is clear and helpful for the intended use case.

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.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: extract JSON from text, infer schema from data, repair malformed JSON, and validate against a schema. There is no overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (extract_json, infer_schema, repair_json, validate_json), making them predictable and easy to distinguish.

Tool Count5/5

With 4 tools, the server is well-scoped for its purpose of JSON handling. Each tool addresses a distinct need without excess or deficiency.

Completeness4/5

The tool set covers core JSON operations: extraction, schema inference, repair, and validation. Minor gaps exist (e.g., no transformation or generation), but the surface is largely complete for common tasks.