Skip to main content
Glama

api_schemas

Extract parameters, request body, and responses using the operationId from ACOMO API schemas. Simplify API exploration and operation analysis within the ACOMO MCP Server.

Instructions

operationIdからparameters/requestBody/responsesを抜粋

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationIdYes

Implementation Reference

  • Handler function for the 'api_schemas' tool. It retrieves the operation schemas using getOperationSchemas and returns them as formatted JSON text or an error if not found.
    async ({ operationId }: { operationId: string }) => { const schemas = await getOperationSchemas(operationId); if (!schemas) return { content: [ { type: "text", text: `Unknown operationId: ${operationId}` }, ], isError: true, }; return { content: [ { type: "text", text: JSON.stringify(schemas, null, 2) }, ], }; }
  • Zod input schema definition for the 'api_schemas' tool, requiring an 'operationId' string.
    inputSchema: { operationId: z.string() },
  • src/server.ts:90-112 (registration)
    Registration of the 'api_schemas' tool using server.registerTool, including title, description, input schema, and inline handler.
    server.registerTool( "api_schemas", { title: "API schemas", description: "operationIdからparameters/requestBody/responsesを抜粋", inputSchema: { operationId: z.string() }, }, async ({ operationId }: { operationId: string }) => { const schemas = await getOperationSchemas(operationId); if (!schemas) return { content: [ { type: "text", text: `Unknown operationId: ${operationId}` }, ], isError: true, }; return { content: [ { type: "text", text: JSON.stringify(schemas, null, 2) }, ], }; } );
  • Core helper function getOperationSchemas that extracts parameters, requestBody schema, and responses from the OpenAPI operation for the given operationId. This is called by the tool handler.
    export async function getOperationSchemas(operationId: string): Promise<{ operationId: string; method: string; path: string; parameters: any[]; // path/query/header requestBody?: any; // schema if available responses?: Record<string, any>; // status -> schema/desc } | null> { const found = await findOperationById(operationId); if (!found) return null; const op = found.raw || {}; const parameters = op.parameters ?? []; let requestBody: any | undefined; if (op.requestBody?.content) { // prefer application/json const json = op.requestBody.content['application/json'] || Object.values(op.requestBody.content)[0]; requestBody = json?.schema ?? json; } const responses: Record<string, any> = {}; if (op.responses) { for (const [code, res] of Object.entries(op.responses)) { const content = (res as any)?.content; const json = content?.['application/json'] || (content && Object.values(content)[0]); responses[code] = json?.schema ?? (res as any)?.description ?? res; } } return { operationId, method: found.method, path: found.path, parameters, requestBody, responses, }; }

Other Tools

Related 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/progress-all/acomo-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server