Skip to main content
Glama
aehyok

swagger-codegen-mcp

by aehyok

generate_api_code

Generate TypeScript API code from Swagger/OpenAPI documentation. Produce whole modules by tag or single endpoints by path and method, with automatic service inference.

Instructions

生成TypeScript API代码。可以按tag生成整个模块,或按单个接口生成。会根据path自动推断对应的服务。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNo按tag生成整个模块的代码(与path/method二选一)
pathNo生成单个接口的代码(与tag二选一)
methodNo配合path使用的HTTP方法
swagger_urlNoSwagger JSON文档的URL(可选,会根据path自动推断服务)
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses a notable behavior (auto-inferring the service from the path), but does not describe the output format, potential side effects, error conditions, or authentication requirements—leaving meaningful gaps for an agent.

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 two sentences, front-loads the main action, and contains no filler. Every clause adds useful information about functionality and behavior.

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 description is adequate for a simple generator tool but lacks elaboration on what the generated output looks like, how to select between modes operationally, and what happens if no parameter is provided. It does not mention the optional swagger_url's role or dependency on sibling discovery tools, leaving some context incomplete.

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?

Although schema descriptions cover 100% of parameters, the description adds semantic context by clarifying that tag and path are mutually exclusive modes and that path auto-infers the service, reinforcing the relationship between parameters beyond the schema's individual descriptions.

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 clearly states the tool's purpose: generating TypeScript API code. It further specifies two generation modes (by tag or by single endpoint), distinguishing it from sibling tools that list or fetch endpoint details.

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 description provides clear usage context: generate code for an entire module via tag or a single API via path. It implicitly frames itself as the code-generation tool among siblings, though it does not explicitly mention when to use alternatives like get_endpoint_detail.

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/aehyok/swagger-codegen-mcp'

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