LearnNewsExamplesServices
Frontmatter
id8442
titleFix getClassHierarchy schema mismatch and JSDoc
stateClosed
labels
bugai
assigneestobiu
createdAtJan 8, 2026, 9:47 PM
updatedAtJan 8, 2026, 9:49 PM
githubUrlhttps://github.com/neomjs/neo/issues/8442
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 8, 2026, 9:49 PM

Fix getClassHierarchy schema mismatch and JSDoc

Closed v11.19.0 bugai
tobiu
tobiu commented on Jan 8, 2026, 9:47 PM

Problem: The get_class_hierarchy tool in the neo.mjs-knowledge-base MCP server has two issues:

  1. The JSDoc for the root parameter in QueryService.mjs incorrectly marks it as optional ([root]), but the implementation throws an error if it is missing.
  2. The openapi.yaml schema defines the output as a map of objects ({ source: string, parent: string }), but the implementation returns a simple map of strings ({ ClassName: ParentName }). This causes validation errors when the tool is called.

Solution:

  1. Update ai/mcp/server/knowledge-base/services/QueryService.mjs: Remove the optional brackets from the root parameter JSDoc.
  2. Update ai/mcp/server/knowledge-base/openapi.yaml: Correct the response schema to match the implementation (a map of strings).
tobiu added the bug label on Jan 8, 2026, 9:47 PM
tobiu added the ai label on Jan 8, 2026, 9:47 PM
tobiu referenced in commit 076c0ac - "fix: Correct getClassHierarchy schema and JSDoc (#8442)" on Jan 8, 2026, 9:48 PM
tobiu assigned to @tobiu on Jan 8, 2026, 9:48 PM
tobiu
tobiu Jan 8, 2026, 9:48 PM

Input from Gemini 3 Pro:

✦ I have corrected the getClassHierarchy tool definition:

  1. JSDoc: Removed the misleading [] from params.root, marking it as required in the documentation to match the implementation.
  2. Schema: Updated openapi.yaml to define the response as a map of strings (additionalProperties: { type: string, nullable: true }) instead of objects, matching the actual return value of QueryService.mjs.

This resolves the validation error where the tool output did not match the schema.

tobiu closed this issue on Jan 8, 2026, 9:49 PM