Skip to main content
Glama

TestingAPIs API tools

Generate a JSON Schema from JSON

generate_json_schema
Read-onlyIdempotent

Create a JSON Schema (draft 2020-12) from a JSON sample. Every item in an array is read, so required, optional and nullable properties are worked out, and strings that are all dates, emails, URLs or UUIDs get a format.

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": {
      "json": "<json>"
    },
    "name": "generate_json_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonYesA JSON sample, such as an API response.
strictNoAdd additionalProperties: false to every object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety bar is covered. The description adds genuine inference semantics beyond them: every array item is read so required/optional/nullable are derived from the union, and format keywords are attached for date/email/URL/UUID strings. It stops short of saying what the output looks like or how inference conflicts are resolved.

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, front-loaded with the action and spec version, then the inference behavior. No filler or restatement of the title.

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 should say what comes back; it characterizes the generated schema's content (required/optional/nullable, formats) but not its shape (JSON text vs object) or how `strict` interacts with the result. Otherwise complete for a two-parameter inference tool.

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 100%, so the baseline is 3: the `json` and `strict` parameters are fully documented in the schema, including that strict adds additionalProperties: false. The description adds no parameter-level detail of its own, only general inference behavior.

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 and resource plus a spec version: 'Create a JSON Schema (draft 2020-12) from a JSON sample.' That is enough to distinguish it in spirit from validate_json_schema and json_to_types, but it never names a sibling or states the boundary explicitly.

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 only implied: you have a JSON sample and want a schema. There is no explicit when-to-use versus validate_json_schema or json_to_types, and no stated preconditions (e.g. input must be valid JSON, size limits).

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