# AI tool schema generator

URL: https://shahid09.is-a.dev/tools/ai-tool-schema-generator/
Author: Muhammad Shahid (https://shahid09.is-a.dev/)
Free tool · runs in your browser

Paste an example of the JSON your AI tool should receive, and get a JSON Schema or a complete Claude tool definition for function calling.

**Quick answer:** AI function calling and structured outputs need a JSON Schema that describes the expected arguments. This tool infers one from a sample: types for every field, nested objects and arrays, every field marked required and additionalProperties: false, which is what strict tool use expects. You can output plain JSON Schema or a Claude tool with name, description and input_schema.

## How to use it

1. **Paste sample JSON.** One realistic example of the arguments, for example a booking with a name, date and number of people.
2. **Name the tool.** Give it a short name and a description of when the model should use it.
3. **Copy the result.** Use it as a tool definition, then add descriptions and enums for the fields that need them.

## Frequently asked questions

### What is function calling?

A way for an AI model to ask your code to run an action, such as looking up an order, by returning structured arguments that match a schema you define.

### Why mark every field as required?

Strict tool use expects a schema where every property is listed as required and no extra properties are allowed, so the model's arguments always match.

### Should I edit the generated schema?

Yes. Add a description to each field, enums for fixed choices and formats such as date, so the model knows exactly what to send.

### How does the generator handle arrays?

It uses the first item of each array to infer the item schema; make sure your sample has at least one item.

### Is my JSON uploaded?

No. The schema is generated in your browser.

### What is the difference between JSON Schema and a tool definition?

JSON Schema describes data. A tool definition wraps a schema with a name and a description, so the model knows when and how to call the tool.

### How should I write a tool description?

Say what the tool does, when to use it and when not to. The model reads this text to decide whether to call the tool.

### How do I make a field optional in a strict schema?

Strict tool use expects every field to be required. To allow "no value", make the field's type a union with null, such as ["string", "null"].

### Can a tool take nested objects and arrays?

Yes, and the generator infers nested schemas from your sample. Keep nesting shallow where you can; simple arguments are easier for models to fill in correctly.

### Should I still validate tool arguments in my code?

Yes. Always validate before running anything, especially actions with side effects, even when the schema is strict.

## Related

- [JSON formatter and validator](https://shahid09.is-a.dev/tools/json-formatter/)
- [How to make AI tool calls safe](https://shahid09.is-a.dev/engineering/ai-agents-langgraph-n8n-production/)
- [Hire an AI agent developer](https://shahid09.is-a.dev/hire/ai-agent-developer/)
