Skip to content

MCP Tools

Overview

swag2mcp provides 19 MCP tools that give an LLM agent full access to your APIs through the Model Context Protocol. These tools cover the complete workflow: discovering what APIs are available, navigating the spec hierarchy, searching and inspecting endpoints, executing API calls, and working with large responses.

What the tools solve

  • Discovery — the LLM can find specs, collections, and tags without knowing IDs in advance
  • Navigation — drill down from spec → collection → tag → endpoint in a structured hierarchy
  • Search — full-text search across all endpoints when you don't have an ID
  • Inspection — get the full OpenAPI operation object before making a call
  • Execution — invoke real API calls with automatic authentication
  • Large response handling — outline, compress, and slice oversized responses that don't fit inline

Read-only vs Mutable

TypeCountTools
Read-only17All discovery, endpoint, search, inspect, info, and response tools
Mutable2invoke (makes real HTTP calls), auth (retrieves tokens)

Read-only tools are marked with ReadOnlyHint=true and IdempotentHint=true in the MCP protocol, signaling to the LLM that they are safe to call without side effects.

Error handling

All tools return errors as structured LLMError objects with a machine-readable code and a human-readable message that explains what went wrong and what to do next:

Error codeMeaning
validation_failedInvalid input (bad ID format, missing required fields)
not_foundEntity not found in the index or workspace
rate_limitSecond invoke call within 10 seconds on the same endpoint
invoke_errorHTTP call failure, download failure
auth_errorAuth token retrieval failure
config_errorConfig file load or save failure
parse_errorSpec file parse failure

Categories

CategoryToolsDescription
Discoveryspec_list, spec_by_id, collection_by_spec, collection_by_id, tag_by_spec, tag_by_collection, tag_by_idNavigate the spec hierarchy: find specs, collections, and tags
Endpointsendpoint_by_spec, endpoint_by_collection, endpoint_by_tag, endpoint_by_idView endpoints at different levels of the hierarchy
Executionsearch, inspect, invokeSearch, inspect the full contract, and call APIs
Utilitiesauth, info, response_outline, response_compress, response_sliceAuth tokens, runtime info, and large response handling
SkillsFormatting guideCustomize how tool responses are displayed

Full List

ToolDescription
spec_listList all API specifications in the workspace
spec_by_idGet detailed spec information with collections
collection_by_specList collections within a spec
collection_by_idGet collection details with tags
tag_by_specList all tags across a spec
tag_by_collectionList tags within a collection
tag_by_idGet tag details (ID, title, method count)
endpoint_by_specList all endpoints in a spec
endpoint_by_collectionList endpoints in a collection
endpoint_by_tagList endpoints in a tag
endpoint_by_idQuick endpoint summary (method, path, summary)
searchFull-text search across all endpoints
inspectFull OpenAPI operation details (parameters, schemas)
invokeExecute a real API call
authGet auth token or headers for a spec
infoRuntime information (version, specs, config)
response_outlineStructural summary of a large response file
response_compressCompress a large response to fit inline
response_sliceExtract a fragment of a large response
spec_list
  └── spec_by_id(id)
        └── collection_by_spec(specId)
              └── collection_by_id(id)
                    └── tag_by_collection(collectionId)
                          └── tag_by_id(id)
                                └── endpoint_by_tag(tagId)
                                      └── endpoint_by_id(id)
                                            └── inspect(endpointId)
                                                  └── invoke(endpointId)

When you don't have an ID, use search to find endpoints by query. When invoke returns a fileRef (response too large), use response_outlineresponse_compress or response_slice to explore the data.