The MCP server must support dynamic tool discovery as described in the protocol specification. A previous refactoring incorrectly implemented a static, hardcoded tool definition within a JavaScript module (tools.mjs), which is contrary to the flexible, API-driven nature of the MCP.
This ticket corrects that architectural error. We will reinstate the use of openapi.yaml as the single, declarative source of truth for tool definitions. The server will parse this file at runtime to build its list of available tools.
Acceptance Criteria
- The static
tools.mjs module is deleted.
- The
toolService.mjs is refactored to parse openapi.yaml at startup.
- During parsing,
operationIds (in camelCase) from the OpenAPI spec will be converted to snake_case to serve as the MCP tool name, following best practices.
- The
listTools function in toolService.mjs will return the list of tools generated from the OpenAPI spec.
- The
callTool function will dynamically execute the correct service function based on the parsed tool definitions.
- The
mcp-stdio.mjs entry point will remain unchanged and will function correctly with the refactored toolService.
The MCP server must support dynamic tool discovery as described in the protocol specification. A previous refactoring incorrectly implemented a static, hardcoded tool definition within a JavaScript module (
tools.mjs), which is contrary to the flexible, API-driven nature of the MCP.This ticket corrects that architectural error. We will reinstate the use of
openapi.yamlas the single, declarative source of truth for tool definitions. The server will parse this file at runtime to build its list of available tools.Acceptance Criteria
tools.mjsmodule is deleted.toolService.mjsis refactored to parseopenapi.yamlat startup.operationIds (incamelCase) from the OpenAPI spec will be converted tosnake_caseto serve as the MCP toolname, following best practices.listToolsfunction intoolService.mjswill return the list of tools generated from the OpenAPI spec.callToolfunction will dynamically execute the correct service function based on the parsed tool definitions.mcp-stdio.mjsentry point will remain unchanged and will function correctly with the refactoredtoolService.