LearnNewsExamplesServices
Frontmatter
id7519
titleDynamically determine argument passing strategy from OpenAPI spec
stateClosed
labels
enhancementai
assigneestobiu
createdAtOct 17, 2025, 12:59 PM
updatedAtOct 17, 2025, 1:00 PM
githubUrlhttps://github.com/neomjs/neo/issues/7519
authortobiu
commentsCount0
parentIssue7501
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 17, 2025, 1:00 PM

Dynamically determine argument passing strategy from OpenAPI spec

Closed v11.0.0 enhancementai
tobiu
tobiu commented on Oct 17, 2025, 12:59 PM

Currently, the shared toolService.mjs contains a hardcoded list of tool names that require their arguments to be passed as a single object to the handler function. This is brittle and not scalable.

This ticket is to refactor the toolService to determine the argument passing strategy dynamically from the OpenAPI specification for each tool. This will be achieved by introducing a custom OpenAPI extension field, x-pass-as-object.

Acceptance Criteria

  1. A custom field, x-pass-as-object: true, is added to the OpenAPI specification for operations whose handlers expect a single arguments object.
  2. The initializeToolMapping function in ai/mcp/server/toolService.mjs is updated to read this flag and store it with the tool's definition.
  3. The callTool function is updated to use this flag to determine whether to pass arguments as a single object or as positional arguments.
  4. The hardcoded array of tool names is removed from callTool.
  5. All tool calls continue to function correctly for both MCP servers.
tobiu assigned to @tobiu on Oct 17, 2025, 12:59 PM
tobiu added parent issue #7501 on Oct 17, 2025, 12:59 PM
tobiu added the enhancement label on Oct 17, 2025, 12:59 PM
tobiu added the ai label on Oct 17, 2025, 12:59 PM
tobiu referenced in commit 5e92dcf - "Dynamically determine argument passing strategy from OpenAPI spec #7519" on Oct 17, 2025, 1:00 PM
tobiu closed this issue on Oct 17, 2025, 1:00 PM