Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

Swagger: Create API from Prompt

swagger_create_api_from_prompt
Read-onlyIdempotent

Generate an API definition from a natural language prompt, applying organization governance and standardization rules. Supports OpenAPI and AsyncAPI specification formats.

Instructions

Generate and save an API definition based on a prompt using SmartBear AI. This tool automatically applies organization governance and standardization rules during API generation. The specType parameter determines the format of the generated definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x, 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.x. Use this tool when creating APIs that comply with governance policies or when generating APIs from natural language descriptions. Use this tool when users ask to create, generate, or design APIs with governance or standardization requirements. Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field indicating whether it was a 'create' or 'update' operation along with API details and SwaggerHub URL.

Toolset: Registry API

Parameters:

  • owner (string) required: API owner (organization or user, case-sensitive)

  • apiName (string) required: API name

  • prompt (string) required: The prompt describing the desired API functionality (e.g., 'Create a RESTful API for managing a pet store with endpoints for pets, orders, and inventory')

  • specType (enum): Specification type for the generated API definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x (default), 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.x (default: "openapi30x")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesAPI owner (organization or user, case-sensitive)
promptYesThe prompt describing the desired API functionality (e.g., 'Create a RESTful API for managing a pet store with endpoints for pets, orders, and inventory')
apiNameYesAPI name
specTypeNoSpecification type for the generated API definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x (default), 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.xopenapi30x
Behavior1/5

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

The description claims to generate and save an API (a write operation), but the annotations declare readOnlyHint=true, indicating a read-only operation. This is a direct contradiction, making the description misleading. As per scoring rules, a contradiction results in score 1.

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

Conciseness4/5

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

The description is well-structured with a clear opening sentence, followed by parameter details, usage guidance, and return information. It is slightly verbose in repeating enum values but overall efficient and readable.

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, the description covers response codes (201, 200), the 'operation' field, and SwaggerHub URL. It also explains governance integration. The tool has 4 parameters and moderate complexity, and the description adequately addresses the context.

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 coverage is 100%, so the baseline is 3. The description adds value by explaining the specType enum values with usage examples and providing context for the prompt parameter (e.g., the pet store example). This goes beyond the schema's basic 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 specifies the verb 'Generate and save' and the resource 'API definition' with clear context of using SmartBear AI. It distinguishes itself from sibling tools like swagger_create_or_update_api by emphasizing AI-powered generation and governance enforcement.

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 explicitly states when to use this tool, e.g., 'when creating APIs that comply with governance policies' or 'when users ask to create, generate, or design APIs with governance'. It does not explicitly exclude other tools but implies that alternative tools should be used if no AI or governance is needed.

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/SmartBear/smartbear-mcp'

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