LearnNewsExamplesServices
Frontmatter
id7499
titleImplement Conditional Omission of Optional Fields in MCP Tool Definitions
stateClosed
labels
enhancementai
assigneestobiu
createdAtOct 15, 2025, 3:55 PM
updatedAtOct 15, 2025, 3:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/7499
authortobiu
commentsCount0
parentIssue7477
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 15, 2025, 3:56 PM

Implement Conditional Omission of Optional Fields in MCP Tool Definitions

Closed v11.0.0 enhancementai
tobiu
tobiu commented on Oct 15, 2025, 3:55 PM

The MCP specification defines several optional fields in tool definitions (e.g., outputSchema, annotations). To ensure strict compliance and avoid sending null values for absent optional fields, this ticket implements conditional omission of these fields from the tools/list response.

Acceptance Criteria

  1. toolService.mjs is modified such that buildOutputZodSchema returns null when no output schema is found.
  2. toolService.mjs is modified such that outputSchema is only included in the allToolsForListing array if outputJsonSchema is not null.
  3. toolService.mjs is modified such that annotations is only included in the allToolsForListing array if operation['x-annotations'] is not null.
  4. The tools/list response correctly omits outputSchema and annotations when they are not present.
tobiu assigned to @tobiu on Oct 15, 2025, 3:55 PM
tobiu added the enhancement label on Oct 15, 2025, 3:55 PM
tobiu added the ai label on Oct 15, 2025, 3:55 PM
tobiu added parent issue #7477 on Oct 15, 2025, 3:55 PM
tobiu referenced in commit ada1188 - "Implement Conditional Omission of Optional Fields in MCP Tool Definitions #7499" on Oct 15, 2025, 3:56 PM
tobiu closed this issue on Oct 15, 2025, 3:56 PM