Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

Swagger: Create API from Prompt

swagger_create_api_from_prompt
Idempotent

Create and save an API definition from a text prompt, automatically applying governance rules. Choose between OpenAPI and AsyncAPI formats for standards-compliant specs.

Instructions

Generate and save a new API or a new version of an existing API 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. Fails with a conflict error if the API version already exists. Returns 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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo
ownerNo
apiNameNo
versionNo
specTypeNo
operationNo
Install Server

TDQS

A4/5.0
Behavior4/5

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

Annotations already indicate a mutating, non-read-only operation. The description adds meaningful behavioral detail beyond them: automatic governance/standardization application, a conflict error if the version exists, and the fact that API details and a SwaggerHub URL are returned. No contradiction with the annotations.

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 description is front-loaded and readable, but it contains two overlapping usage sentences and reproduces the parameter descriptions/specType values that are already in the schema. It is adequately sized but not sharply concise.

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?

For a create operation with output schema and full parameter coverage, the description is complete: it states behavior, governance side effects, conflict failure mode, and return value. It does not spell out alternative tools or when not to use it, but that is a minor gap rather than a missing blocker.

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%, so the baseline is 3. The prose repeats the specType enum values and documents owner/API name/prompt, but it does not add semantic meaning beyond what the input schema already provides, such as version handling or format constraints.

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 combination: 'Generate and save a new API or a new version of an existing API based on a prompt using SmartBear AI.' This clearly distinguishes it from generic SwaggerHub update/portal/contract tools and scopes the operation to AI-prompt-based API generation.

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?

It gives direct when-to-use guidance: 'Use this tool when creating APIs that comply with governance policies or when generating APIs from natural language descriptions,' plus a second user-intent phrasing. It does not name sibling alternatives or explicitly say when not to use it, so it stops short of 5.

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

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