The MCP SDK schema validation requires nextCursor to be string | undefined, but null is being returned in the catch blocks of listTools handlers across all MCP servers (Neural Link, Knowledge Base, GitHub Workflow, Memory Core) and in the default return of ToolService.mjs. This causes a "Invalid input: expected string, received null" error that masks the underlying exception when tool discovery fails.
This task involves updating the logic in:
ai/mcp/ToolService.mjs
ai/mcp/server/neural-link/Server.mjs
ai/mcp/server/knowledge-base/Server.mjs
ai/mcp/server/github-workflow/Server.mjs
ai/mcp/server/memory-core/Server.mjs
Additionally, ai/mcp/validation/OpenApiValidator.mjs needs to be robust against OpenAPI array schemas that do not define an items property (defaulting to any[]).
The MCP SDK schema validation requires
nextCursorto bestring | undefined, butnullis being returned in thecatchblocks oflistToolshandlers across all MCP servers (Neural Link, Knowledge Base, GitHub Workflow, Memory Core) and in the default return ofToolService.mjs. This causes a "Invalid input: expected string, received null" error that masks the underlying exception when tool discovery fails.This task involves updating the logic in:
ai/mcp/ToolService.mjsai/mcp/server/neural-link/Server.mjsai/mcp/server/knowledge-base/Server.mjsai/mcp/server/github-workflow/Server.mjsai/mcp/server/memory-core/Server.mjsAdditionally,
ai/mcp/validation/OpenApiValidator.mjsneeds to be robust against OpenAPI array schemas that do not define anitemsproperty (defaulting toany[]).