Frontmatter
| id | 7499 |
| title | Implement Conditional Omission of Optional Fields in MCP Tool Definitions |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Oct 15, 2025, 3:55 PM |
| updatedAt | Oct 15, 2025, 3:56 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7499 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | 7477 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Oct 15, 2025, 3:56 PM |
The MCP specification defines several optional fields in tool definitions (e.g.,
outputSchema,annotations). To ensure strict compliance and avoid sendingnullvalues for absent optional fields, this ticket implements conditional omission of these fields from thetools/listresponse.Acceptance Criteria
toolService.mjsis modified such thatbuildOutputZodSchemareturnsnullwhen no output schema is found.toolService.mjsis modified such thatoutputSchemais only included in theallToolsForListingarray ifoutputJsonSchemais notnull.toolService.mjsis modified such thatannotationsis only included in theallToolsForListingarray ifoperation['x-annotations']is notnull.tools/listresponse correctly omitsoutputSchemaandannotationswhen they are not present.