MCP-shaped output
Receive the core name, description, and inputSchema fields as copy-ready JSON.
Start typing to search 227 tools.
Generate a minimal MCP tool definition and Draft 2020-12 inputSchema from a tool name, description, and representative JSON arguments.
MCP Tool Schema Generator creates a compact Model Context Protocol tool definition from a name, description, and sample JSON arguments. The output contains the core name, description, and inputSchema fields used when an MCP server exposes a callable tool.
The sample is converted deterministically into JSON Schema Draft 2020-12. Object keys become properties, observed values determine initial types, every observed property is marked required, and generated objects use additionalProperties: false. This gives you a strict starting point that must still be edited to describe optional fields, accepted ranges, enums, formats, and alternative shapes.
search_docs.Focused controls, predictable output, and a workflow designed around this exact transformation.
Receive the core name, description, and inputSchema fields as copy-ready JSON.
Objects, arrays, strings, integers, numbers, booleans, and null samples become schema nodes.
Generated object schemas reject undeclared properties until you intentionally allow them.
No model call or external API is required to infer the initial schema.
Practical details about input, output, privacy, limits, and the best way to use this tool.
It creates a minimal tool definition containing name, description, and inputSchema.
The generated inputSchema declares JSON Schema Draft 2020-12.
Yes. A sample cannot reveal which fields are optional, so every observed property is initially required. Remove optional names from the required array manually.
The first array item determines the generated item schema. Review heterogeneous arrays and empty arrays manually.
No. A raw value cannot explain business meaning or the complete set of allowed values. Add descriptions, enum values, limits, patterns, and formats yourself.
Yes. Use an empty JSON object and keep an object schema with additionalProperties: false.
No. It only generates JSON. Registration and execution remain the responsibility of your MCP server or SDK.
No external AI request is needed for generation. Even so, use sanitized samples rather than credentials or private customer data.
The sample establishes initial property names and primitive types.
Tool name: search_docs
Description: Search product documentation for matching passages
Sample JSON:
{"query":"refund policy","limit":5,"include_archived":false}
{
"name": "search_docs",
"description": "Search product documentation for matching passages",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"query": {"type": "string"},
"limit": {"type": "integer"},
"include_archived": {"type": "boolean"}
},
"required": ["query", "limit", "include_archived"],
"additionalProperties": false
}
}
Nested objects are inferred recursively and array items use the first observed element.
Tool name: create_ticket
Sample JSON:
{"customer":{"id":"cus_42","vip":true},"tags":["billing"]}
customer → object customer.id → string customer.vip → boolean tags → array of string
MCP tool arguments are objects, so a scalar sample is exposed through a value property.
Tool name: submit_score Sample JSON: 42
{
"type": "object",
"properties": {
"value": {"type": "integer"}
},
"required": ["value"],
"additionalProperties": false
}
An MCP tool has a programmatic name, an optional human-readable description, and an inputSchema that describes its arguments. Current MCP documentation also defines optional display metadata, output schemas, annotations, icons, and extension metadata. This generator intentionally creates the portable core rather than guessing optional fields from data that cannot express them.
Choose a name that is unique within the server and stable across releases. Current MCP guidance recommends 1–128 ASCII letters, digits, underscores, hyphens, or dots. The description should distinguish the action from similar tools and state when it should be used.
JSON objects become schemas with type: object. Each key becomes a property and its value supplies an initial type. Nested objects are processed recursively. Integers and decimal numbers remain distinct, booleans remain boolean, and strings remain string. A root scalar or array is wrapped in a value property because MCP tool arguments use an object input schema.
The generated schema includes a Draft 2020-12 identifier. MCP defaults tool schemas to Draft 2020-12 when no schema identifier is supplied, but an explicit identifier makes the intended dialect easier to audit.
Inference can observe only the supplied example. It cannot know that limit is optional, that a string must be one of three enum values, or that an integer must fall within a range. Every observed property is therefore marked required. Remove optional names from required and add business constraints deliberately.
For an array, the first item supplies the item schema. An empty array has no evidence for an item type, and a heterogeneous array may contain shapes not represented by its first element. Add items, minItems, composition rules, or a manually reviewed object schema when the real contract is broader.
Sample-based generation does not infer descriptions, defaults, enum choices, formats, patterns, numeric boundaries, conditional rules, outputSchema, annotations, permissions, side effects, or confirmation requirements. A null sample proves only that the observed value is null; it does not identify the intended non-null type. Property names are preserved, while invalid characters in the tool name are normalized.
The generated definition does not test an MCP connection, call the tool, validate handler behavior, or prove that every client accepts the same schema features. Treat it as editable source code, not a completed security boundary.
Generate from a small representative object, then edit descriptions and optional fields. Check the result with MCP Schema Validator. For an OpenAI-specific tool wrapper, compare the structure using JSON to OpenAI Function Schema. Validate detailed JSON Schema constraints with JSON Schema Validator, then run calls through the exact MCP SDK and client versions used in production.
Review the current MCP tools specification and the JSON Schema Draft 2020-12 core specification before publishing a production tool.