Skip to main content
Glama

generate-openapi

Generates OpenAPI 3.0 specification documents from Java, JavaScript, or TypeScript API code by converting route information into structured API documentation.

Instructions

生成OpenAPI规范文档

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>",
      "language": "<language>"
    },
    "name": "generate-openapi"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesAPI代码内容
languageYes编程语言

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description bears the full burden of behavioral disclosure, and it tells the agent nothing beyond the title. It does not say whether the generated spec is returned as text or written to a file, which OpenAPI version is produced, whether the input code is modified, or whether there are size or complexity limits.

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

Conciseness3/5

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

The single phrase is front-loaded and free of filler, but it is terse to the point of under-specification; there is no second sentence to carry usage or output context. Brevity here reflects a thin definition rather than disciplined editing.

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

Completeness2/5

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

For a two-parameter generation tool with no output schema, the description should at least characterize the returned artifact and its format. Instead it only restates the tool name, leaving the agent unable to predict the shape or destination of the generated specification.

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?

Schema description coverage is 100%, with both code and language documented in the schema, including an enum of supported languages. The description adds no further meaning about expected code completeness or language-specific behavior, so the baseline of 3 is appropriate.

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 names a specific verb plus resource: generate an OpenAPI specification document. That is unambiguous on its own, but it makes no attempt to distinguish this from the sibling tools generate-tests and validate-api, so an agent must infer which stage of the workflow it belongs to.

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

Usage Guidelines2/5

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

There is no guidance about when to use this tool rather than validate-api or generate-tests, no prerequisites such as requiring an existing API definition, and no indication of what a suitable input looks like. The agent is left to infer usage entirely from the name.

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

Deploy Server

Other Tools