Skip to main content
Glama

json_to_schema

Read-only

Turn a JSON sample (or an array of samples of the same shape) into a JSON Schema draft 2020-12 and a TypeScript type. Infers required vs optional keys across samples, nullable fields, integer vs number, date/email/uri/uuid formats, and small enums. Use it to draft an MCP tool inputSchema from an example payload.

Input Schema

NameRequiredDescriptionDefault
jsonYesThe JSON text. Free tier: 20,000 chars.
nameNoType name, default Root

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=false, destructiveHint=false), so the description's job is to add substance beyond that—and it does, listing exactly what is inferred: required vs optional keys across samples, nullability, integer vs number, format detection, and small enums. It still doesn't say how invalid or malformed JSON is handled, which is the main remaining gap.

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 dense sentences, front-loaded with the transformation and followed by the inference capabilities and the intended use case. Every clause carries information; nothing is padding.

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 must convey the return values, and it does name both artifacts (JSON Schema draft 2020-12 and a TypeScript type). Combined with the stated inference behavior, an agent has enough to call it correctly; only error/failure behavior is unaddressed.

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 description coverage is 100%, so the two parameters (json, name) are already documented, establishing a baseline of 3. The description adds only one marginal semantic detail—that the JSON text may be an array of samples of the same shape—which is not obvious from the schema's 'JSON text' wording.

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?

States a specific transformation: JSON sample(s) in, JSON Schema draft 2020-12 plus a TypeScript type out. The verb+resource pair is unambiguous, and no sibling tool (check_headers, lint_agent_md, explain_cron, etc.) overlaps with it.

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?

Explicitly names the use case: 'draft an MCP tool inputSchema from an example payload.' That gives clear context for when to reach for it. It does not state when not to use it, but among the siblings there is no competing alternative to exclude.

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