Tools

Tool schema builder for strict mode

Strict mode rejects schemas that are perfectly valid JSON Schema. Every property must be required, every object must forbid extra properties, and some keywords are refused outright. Paste a sample object, get a schema that passes, wrapped for the provider you are calling.

Generated schema


  

Check a schema that was rejected

Paste a schema and press Check it.

What strict mode actually requires

Four rules cause almost every rejection. Every object needs additionalProperties: false, at every level including the root. Every property must appear in required, so an optional field is expressed as a nullable type instead of by omission. strict: true belongs inside the function object, and putting it at the top level of the tool is silently ignored. A handful of keywords are refused outright, including pattern and format, which is why a schema that validates in a JSON Schema library can still be rejected by the API.

The nullable trick is the one that surprises people. A field the model may leave out is written as a type array such as ["string", "null"] and still listed in required. Omitting it from required looks optional and behaves unpredictably, because the model can then return the object without the key at all.

The providers disagree at the edges

Anthropic wraps the same schema as input_schema and hands you already-parsed arguments. MCP calls it inputSchema and is stricter about types. Google takes an OpenAPI-style subset with uppercase type names and no additionalProperties, so a schema written for OpenAI needs translating rather than copying. This page emits all four shapes from one sample so you do not discover the differences in production.

Why inference from a sample is only a starting point

One example tells you the types of the values you happened to include. It cannot know that units only accepts two strings, or that days has an upper bound, so the enums and limits here are yours to add. A sample with null in it is read as a nullable field, which is usually what you want and occasionally is not.

Keep the argument object small for a second reason. Strict mode requires every property to be present, so a schema with a dozen fields asks the model to satisfy a dozen constraints at once, and compliance falls off sharply past about six of them. Splitting one large tool into two focused ones is usually cheaper than one tool that is always half filled.