Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

Swagger: Create or Update API

swagger_create_or_update_api
Read-onlyIdempotent

Create or update an API in SwaggerHub Registry. Automatically detects specification type (OpenAPI/AsyncAPI) and returns create or update status with API details.

Instructions

Create a new API or update an existing API in SwaggerHub Registry for Swagger Studio. The API specification type (OpenAPI, AsyncAPI) is automatically detected from the definition content. APIs are always created with fixed values: version 1.0.0, private visibility, and automock disabled (these values cannot be changed). 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: Organization name (owner of the API)

  • apiName (string) required: API name

  • definition (string) required: API definition content (OpenAPI/AsyncAPI specification in JSON or YAML format). Format is automatically detected. API is created with fixed values: version 1.0.0, private visibility, automock disabled, and no project assignment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesOrganization name (owner of the API)
apiNameYesAPI name
definitionYesAPI definition content (OpenAPI/AsyncAPI specification in JSON or YAML format). Format is automatically detected. API is created with fixed values: version 1.0.0, private visibility, automock disabled, and no project assignment.
Behavior1/5

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

Description states the tool creates or updates (mutational behavior), but annotations declare readOnlyHint=true, which contradicts. This is a serious inconsistency. The description also lacks disclosure of auth requirements or side effects beyond what annotations provide. Score 1 due to annotation contradiction.

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?

Description is well-structured with toolset and parameter sections. However, there is slight redundancy (fixed values mentioned twice). It is not overly verbose, earning a 4.

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?

Given no output schema, description does explain response codes and 'operation' field, which is good. However, the annotation contradiction leaves the agent uncertain about true behavioral safety. The tool is a mutation, but readOnlyHint=true misleads. This incompleteness reduces score.

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% (baseline 3). Description adds value by explaining auto-detection of format, fixed values like version 1.0.0, private visibility, and automock disabled. This enriches understanding beyond the schema descriptions.

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?

Description clearly states the tool creates or updates an API in SwaggerHub Registry, with specific verb+resource. It mentions auto-detection of spec type. However, it does not explicitly differentiate from the sibling 'swagger_create_api_from_prompt', though the 'from definition' angle provides indirect distinction.

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?

Description implies usage context (creating/updating APIs from definition content) but provides no explicit guidance on when not to use this tool or alternatives like 'swagger_create_api_from_prompt'. No exclusion criteria are given.

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