Goal
Fix a routing bug in the neo.mjs-knowledge-base MCP server that prevented the manage_knowledge_base and manage_database tools from receiving their arguments correctly when called via the internal Node.js SDK (ai/services.mjs).
Context
During an attempt to trigger a knowledge base sync, the manage_knowledge_base tool threw an error: Invalid action: undefined.
Investigation revealed that ai/services.mjs uses OpenApiValidator.mjs and the openapi.yaml spec to dynamically generate Zod schemas and validate/route arguments to the underlying service methods.
If an OpenAPI endpoint lacks the x-pass-as-object: true annotation, the SDK attempts to map the JSON request body properties to positional arguments based on a heuristic, which fails for complex service methods that expect a single destructured config object (e.g., manageKnowledgeBase({action})).
The query_documents tool had this annotation, but the newer manage_database and manage_knowledge_base tools introduced in Epic #8315 were missing it.
Acceptance Criteria
- Add
x-pass-as-object: true to the /db/manage (manage_database) path in ai/mcp/server/knowledge-base/openapi.yaml.
- Add
x-pass-as-object: true to the /db/data/manage (manage_knowledge_base) path in the same file.
- Verify that calling these tools via the SDK correctly passes the arguments as an object.
Goal
Fix a routing bug in the
neo.mjs-knowledge-baseMCP server that prevented themanage_knowledge_baseandmanage_databasetools from receiving their arguments correctly when called via the internal Node.js SDK (ai/services.mjs).Context
During an attempt to trigger a knowledge base sync, the
manage_knowledge_basetool threw an error:Invalid action: undefined. Investigation revealed thatai/services.mjsusesOpenApiValidator.mjsand theopenapi.yamlspec to dynamically generate Zod schemas and validate/route arguments to the underlying service methods.If an OpenAPI endpoint lacks the
x-pass-as-object: trueannotation, the SDK attempts to map the JSON request body properties to positional arguments based on a heuristic, which fails for complex service methods that expect a single destructured config object (e.g.,manageKnowledgeBase({action})).The
query_documentstool had this annotation, but the newermanage_databaseandmanage_knowledge_basetools introduced in Epic #8315 were missing it.Acceptance Criteria
x-pass-as-object: trueto the/db/manage(manage_database) path inai/mcp/server/knowledge-base/openapi.yaml.x-pass-as-object: trueto the/db/data/manage(manage_knowledge_base) path in the same file.