list_openapi_spec_sources
Fetch available source URLs for OpenAPI specifications, enabling developers to integrate API definitions into their AI-powered IDEs via SushiMCP.
Instructions
This tool lists all available source urls where an OpenAPI spec can be fetched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- The main handler function that implements the logic for the 'list_openapi_spec_sources' tool. It formats and returns a list of available OpenAPI spec sources passed via apiSpecSources.export const list_openapi_spec_sources = async ( extra: RequestHandlerExtra<ServerRequest, ServerNotification>, apiSpecSources: Record<string, string> ): Promise<CallToolResult> => { if (Object.keys(apiSpecSources).length === 0) { return { content: [ { type: "text", text: "No OpenAPI specifications configured." }, ], }; } let formatted_specs = "Available OpenAPI specifications:\n"; for (const name in apiSpecSources) { formatted_specs += `- ${name}: ${apiSpecSources[name]}\n`; } const content: TextContent[] = [ { type: "text", text: formatted_specs.trim() }, ]; return { content }; };
- src/index.ts:114-119 (registration)Registers the 'list_openapi_spec_sources' tool with the MCP server, providing its description and handler wrapper that passes CLI-provided openApiSpecs.server.tool( "list_openapi_spec_sources", "This tool lists all available source urls where an OpenAPI spec can be fetched.", (extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => list_openapi_spec_sources(extra, openApiSpecs) );
- src/index.ts:66-77 (registration)Declares the tool capability in the MCP server's capabilities object, including name, description, and annotations.list_openapi_spec_sources: { name: "list_openapi_spec_sources", description: "List the source urls where an OpenAPI spec can be fetched.", annotations: { title: "List OpenAPI spec sources", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, },
- src/index.ts:11-14 (registration)Imports the list_openapi_spec_sources handler from the tools module.list_llms_txt_sources, fetch_llms_txt, fetch_openapi_spec, list_openapi_spec_sources,
- src/tools/index.ts:5-5 (registration)Re-exports the tool handler from its implementation file.export * from "./list_openapi_spec_sources.js";