AI Function Calling Schema Generator
Turn a TypeScript interface into OpenAI, Anthropic, or Gemini tool JSON.
TypeScript interface
Tool schema
Paste a TypeScript interface to generate a schema
Results update as you type. Nothing leaves your browser.
Examples
Optional and union handling
generateFunctionCallingSchema("interface SearchArgs { query: string; limit?: number; mode: \"fast\" | \"deep\" }"){ required: ["query", "mode"], properties: { mode: { enum: ["fast", "deep"] } } }The ? field drops from required while the pure literal union collapses to an enum.
Gemini envelope
generateFunctionCallingSchema("interface Ping { value: number }", "gemini"){ functionDeclarations: [{ name: "Ping", parameters: { type: "object", ... } }] }The same parameters object nests under functionDeclarations with additionalProperties false.
About this tool
Function Calling Schema Generator turns TypeScript shapes into tool schemas with generateFunctionCallingSchema(source, format): interface or object type declarations parse into a ParsedFunctionSchema with name, optional description, and a parameters object carrying properties, required, and additionalProperties false.
Documentation transfers automatically: leading /** */ summaries become the function description, @param tags and inline property comments become per-property descriptions, optional ? fields stay out of required, and nested inline objects, arrays, primitives, and literal unions map to JSON Schema (pure string/number/boolean unions become enum, mixed unions become anyOf).
Three target envelopes ship deterministically: openai wraps as { type: function, function: { name, description, parameters, strict: true } }, anthropic as { name, description, input_schema }, and gemini as { functionDeclarations: [{ name, description, parameters }] }, with invalid input returning schema null plus an error.
How to use this tool
Paste the interface
Provide an interface or object type — JSDoc summaries and @param lines ride along as descriptions.
Pick the target
Choose openai, anthropic, or gemini to switch the envelope around the same parameters object.
Validate
Check required excludes ? fields, unions show enum or anyOf, and empty input surfaces an error.
Use cases
Wiring OpenAI function calling
Convert request interfaces into strict function tools with descriptions intact.
Targeting Claude tool use
Reuse the same interface for Anthropic input_schema envelopes.
Targeting Gemini declarations
Emit functionDeclarations payloads for Vertex and AI Studio tool config.
Common mistakes
Mistake:Expecting ? fields in required.
Fix:Optional properties are excluded by design — only bare name: type entries land in required.
Mistake:Reading every union as an enum.
Fix:Only all-literal unions become enum; mixed or object unions emit anyOf branches instead.
Frequently asked questions
What does this tool do?
It parses TypeScript interfaces with generateFunctionCallingSchema into JSON Schema parameters (properties, required, additionalProperties false) wrapped for openai, anthropic (input_schema), or gemini (functionDeclarations) targets.
How are descriptions, optionals, and unions handled?
JSDoc summaries and @param tags become descriptions, ? fields drop from required, pure literal unions become enum while mixed unions become anyOf, and OpenAI output sets strict true.
Is my interface uploaded or stored?
No. Type parsing and envelope building run entirely in your browser.
Why is schema null, or required missing a field?
Non-interface or empty inputs return schema null with an explanatory error, and optional ? properties are excluded from required by design.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.