Skip to main content
Glama
mantle-bearer

fastapi-mcp-server

get_typescript_definition

Generate strict TypeScript interfaces and types from Pydantic models, FastAPI applications, or live OpenAPI URLs to keep frontend types in sync.

Instructions

Generate strict TypeScript interfaces and types from a Pydantic model, FastAPI app, or live OpenAPI URL.

Args: target: Target identifier (e.g. 'models.user:UserProfile', 'main:app', 'https://api.example.com/openapi.json'). project_dir: Optional path to the project root directory.

Returns: TypeScript interface/type definitions code as a string, or an error dictionary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes
project_dirNo
Behavior3/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It clearly states that the tool returns TypeScript code as a string or an error dictionary, which is useful, but it does not disclose side effects, network behavior for live URLs, or what triggers the error return path.

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 front-loaded with the core purpose and then provides a compact Args/Returns structure. Every sentence contributes useful information, and there is no filler or repetition of schema details.

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

Completeness4/5

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

Given that there is no output schema and no annotations, the description gives enough context for an agent to understand the input sources and expected return value. It stops short of explaining error dictionary structure or the exact behavior when a target cannot be resolved, but it is reasonably complete for this complexity level.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate for the schema's bare string fields. It does meaningfully enrich 'target' with concrete formats like 'models.user:UserProfile', 'main:app', and an OpenAPI URL, and it clarifies that 'project_dir' is an optional path to the project root.

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

Purpose4/5

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

The description opens with a specific verb and resource: 'Generate strict TypeScript interfaces and types' from a Pydantic model, FastAPI app, or live OpenAPI URL. It is clear about what the tool produces, but it does not explicitly differentiate it from sibling tools like get_zod_schema or get_openapi_schema.

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

Usage Guidelines3/5

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

The description implies usage by listing the accepted source types ('Pydantic model, FastAPI app, or live OpenAPI URL') and giving target examples, so an agent can infer when it is relevant. However, it provides no explicit when-to-use, when-not-to-use, or comparison with alternatives.

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/mantle-bearer/fastapi-mcp-server'

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