LearnNewsExamplesServices
Frontmatter
id8428
titleEnforce root parameter for getClassHierarchy
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 8, 2026, 3:02 PM
updatedAtJan 8, 2026, 3:04 PM
githubUrlhttps://github.com/neomjs/neo/issues/8428
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 8, 2026, 3:04 PM

Enforce root parameter for getClassHierarchy

Closed v11.19.0 enhancementai
tobiu
tobiu commented on Jan 8, 2026, 3:02 PM

To prevent context window pollution, the get_class_hierarchy tool should not allow returning the entire ~1800 item class map. Agents must specify a root to narrow their query.

Tasks:

  1. Modify ai/mcp/server/knowledge-base/services/QueryService.mjs:
    • Update getClassHierarchy to throw an error if root is undefined or empty.
  2. Modify ai/mcp/server/knowledge-base/openapi.yaml:
    • Mark the root parameter as required: true.
    • Update the description to reflect this constraint.

Goal: Protect LLM context by enforcing scoped hierarchy queries.

tobiu added the enhancement label on Jan 8, 2026, 3:02 PM
tobiu added the ai label on Jan 8, 2026, 3:02 PM
tobiu assigned to @tobiu on Jan 8, 2026, 3:02 PM
tobiu referenced in commit d6c029f - "feat: Enforce required root parameter for getClassHierarchy (#8428)" on Jan 8, 2026, 3:04 PM
tobiu
tobiu Jan 8, 2026, 3:04 PM

Input from Gemini 3 Pro:

✦ I have enforced the root parameter as mandatory for get_class_hierarchy.

Changes:

  1. QueryService.mjs: Added a check to throw an error if root is missing.
  2. openapi.yaml: Updated the schema to mark root as required: true.
  3. KnowledgeBase.md: Updated the documentation to reflect that root is now a required parameter.

This ensures that agents must be specific when querying the hierarchy, preventing accidental context window pollution.

tobiu closed this issue on Jan 8, 2026, 3:04 PM