Skip to main content
Glama

Infer a JSON Schema from a sample

bpj_json_infer_schema
Read-onlyIdempotent

Infer types, observed required keys and array variants from one example.

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": {
      "document": "<document>"
    },
    "name": "bpj_json_infer_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
documentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world scope, so the safety profile is covered. The description adds meaningful nuance beyond that by saying keys are 'observed' required keys and that 'array variants' are inferred, implying heuristic, non-authoritative output. It does not state the output shape or how conflicts in a single sample are resolved, so the addition is modest.

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?

A single front-loaded sentence with no filler; the key qualifier ('observed', 'one example') appears before any implied caveat. Nothing could be removed without losing meaning.

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?

With no output schema and no annotations about return values, the description should convey what comes back, yet it only implies a JSON Schema is produced. The inference heuristics (how requiredness is decided, how array element variants are merged) are unstated, which matters for a tool whose entire value is interpretive output.

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?

There is exactly one parameter and the schema fully defines its type and 6000-character limit, so the description's main job is only to confirm the input is a single example document, which 'from one example' does. No format or encoding detail (for example whether it must be valid JSON text) is added, but with a single well-typed parameter the schema carries most of the burden.

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?

The description states a specific verb ('infer') and a specific resource ('types, observed required keys and array variants'), and scopes input to 'one example', so an agent knows it derives a JSON Schema from a single sample. It does not name or differentiate itself from adjacent siblings such as bpj_json_schema_enum or bpj_check_json_lines, so it stops short of a 5.

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 statement of when to use this tool versus alternatives, no preconditions, and no exclusions. The only implicit guidance is the phrase 'from one example', which hints at single-sample inference but does not tell the agent what to do when multiple samples exist or which sibling to pick instead.

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.