List APIs
list_apisRetrieve a complete list of APIs available in the ACOMO MCP Server for API exploration and backend service interaction.
Instructions
acomoのAPI一覧を返す
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_apis"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:34-46 (registration)Registers the 'list_apis' MCP tool with an empty input schema. The handler serializes the result of listOperations() as JSON text content.
server.registerTool( "list_apis", { title: "List APIs", description: "acomoのAPI一覧を返す", inputSchema: {}, }, async () => ({ content: [ { type: "text", text: JSON.stringify(await listOperations()) }, ], }) ); - src/server.ts:41-45 (handler)The tool handler function passed to registerTool, which calls listOperations() and returns the result as JSON-formatted text.
async () => ({ content: [ { type: "text", text: JSON.stringify(await listOperations()) }, ], }) - src/openapi.ts:21-26 (schema)TypeScript type definition for an API Operation, used as the structure for list_apis output.
export type Operation = { operationId?: string; method: string; path: string; summary?: string; }; - src/openapi.ts:28-49 (helper)Main helper function that loads the OpenAPI specification and extracts a list of operations (operationId, method, path, summary). This is the core logic executed by the list_apis tool.
export async function listOperations(): Promise<Operation[]> { const spec = await loadOpenApi(); const result: Operation[] = []; for (const [path, methods] of Object.entries(spec.paths ?? {})) { for (const [method, op] of Object.entries(methods ?? {})) { // skip non-http verbs if ( !["get", "post", "put", "delete", "patch", "head", "options"].includes( method.toLowerCase() ) ) continue; result.push({ operationId: (op as any)?.operationId, method: method.toUpperCase(), path, summary: (op as any)?.summary, }); } } return result; }