Skip to main content
Glama

generateApiModels

Convert OpenAPI/Swagger specs into typed TypeScript interfaces or Python dataclasses, pydantic models, and TypedDicts. Resolves $refs, enums, and nested schemas automatically.

Instructions

Generate typed data models from OpenAPI/Swagger spec. Creates TypeScript interfaces/types or Python dataclasses/pydantic/TypedDict from API schemas. Handles $ref resolution, enums, allOf/oneOf, nested objects. Use after loadSwagger to generate model files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleNoTypeScript only: 'interface' (default) or 'type' aliases
formatNoSpec format (default: auto)
sourceYesURL or file path to OpenAPI spec
schemasNoGenerate only these schemas (default: all)
languageYesTarget language for models
pythonStyleNoPython only: 'dataclass' (default), 'pydantic', or 'typeddict'
includeEnumsNoGenerate enum types (default: true)
includeValidationNoInclude validation constraints as comments (default: false)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It goes beyond a generic statement by enumerating technical behaviors: $ref resolution, enums, allOf/oneOf, and nested objects. It also discloses the side effect of generating model files, but stops short of mentioning overwrite behavior or output location.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences, each earning its place. It front-loads the core purpose, then adds capabilities and usage timing. No redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 8 parameters and no output schema or annotations. The description covers the core functionality and dependency on loadSwagger, but leaves out output specifics (e.g., where files are written, return value, error behavior). It is adequate but not fully complete for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 8 parameters have schema descriptions (100% coverage), so the baseline is 3. The description does not add additional context for any specific parameter beyond what the schema provides; it only references languages and styles in a general way, which the schema already caps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Generate typed data models from OpenAPI/Swagger spec.' It names target output types (TypeScript interfaces/types, Python dataclasses/pydantic/TypedDict) and source schemas, clearly distinguishing it from sibling tools like loadSwagger.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The final sentence 'Use after loadSwagger to generate model files' provides clear context for when to invoke this tool, directly referencing a sibling as a prerequisite. It does not explicitly state exclusions or alternatives, but the relationship to loadSwagger is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docentovich/chrometools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server