Frontmatter
| id | 7535 |
| title | Enhance MCP ToolService to Support OpenAPI Keywords |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Oct 18, 2025, 11:40 AM |
| updatedAt | Oct 18, 2025, 12:08 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7535 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Oct 18, 2025, 12:08 PM |
Enhance MCP ToolService to Support OpenAPI Keywords
tobiu assigned to @tobiu on Oct 18, 2025, 11:40 AM

tobiu
Oct 18, 2025, 12:08 PM
resolved via https://github.com/neomjs/neo/commit/e272eb7bb355091d08b7fac278a1cd7f3850a85e (used the wrong ticket id for the commit)
tobiu closed this issue on Oct 18, 2025, 12:08 PM
The
ai/mcp/server/toolService.mjsis responsible for parsing OpenAPI specifications and generating Zod schemas for validating tool inputs and outputs. The current implementation ofbuildZodSchemaFromResponseis too simplistic and does not support common OpenAPI keywords likeoneOf,required, andnullable. This leads to schema validation errors when the OpenAPI spec uses these features.This ticket is to enhance the
buildZodSchemaFromResponsefunction to correctly handle these keywords, making the tool service more robust and compliant with the OpenAPI specification.Acceptance Criteria
buildZodSchemaFromResponsefunction inai/mcp/server/toolService.mjsis updated to handle theoneOfkeyword by mapping it to Zod'sz.union.requiredkeyword for object properties, making properties optional in the Zod schema if they are not in therequiredlist.nullable: trueby applying.nullable()to the Zod schema.openapi.yamlfor the memory-core server is simplified to usenullable: truefor thepidproperty, removing the need for complexoneOfconstructs.neo-memory-core__healthchecktool passes successfully with these changes.