DevTools Logo

AI Function Calling Schema Generator

AI Function Calling Schema Generator

Turn a TypeScript interface into OpenAI, Anthropic, or Gemini tools JSON entirely in your browser

Interface input

Supports JSDoc descriptions, @param tags, primitive and union types, arrays, and one-level nested objects.

About

Parse simplified TypeScript interfaces and object types into provider-specific function calling JSON. JSDoc descriptions, optional fields, unions, arrays, and one-level nested objects are supported locally with strict additionalProperties handling.

Examples

Optional and union handling

Input
generateFunctionCallingSchema("interface SearchArgs { query: string; limit?: number; mode: \"fast\" | \"deep\" }")
Output
{ required: ["query", "mode"], properties: { mode: { enum: ["fast", "deep"] } } }

The ? field drops from required while the pure literal union collapses to an enum.

Gemini envelope

Input
generateFunctionCallingSchema("interface Ping { value: number }", "gemini")
Output
{ 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

  1. Paste the interface

    Provide an interface or object type — JSDoc summaries and @param lines ride along as descriptions.

  2. Pick the target

    Choose openai, anthropic, or gemini to switch the envelope around the same parameters object.

  3. 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.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.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.

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML

Apache Config Generator

Build an Apache 2.4 VirtualHost — ServerName, DocumentRoot, Directory, aliases, and optional SSL