Frontmatter
| id | 8428 |
| title | Enforce root parameter for getClassHierarchy |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Jan 8, 2026, 3:02 PM |
| updatedAt | Jan 8, 2026, 3:04 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8428 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 8, 2026, 3:04 PM |
Enforce root parameter for getClassHierarchy
tobiu assigned to @tobiu on Jan 8, 2026, 3:02 PM

tobiu
Jan 8, 2026, 3:04 PM
Input from Gemini 3 Pro:
✦ I have enforced the
rootparameter as mandatory forget_class_hierarchy.Changes:
QueryService.mjs: Added a check to throw an error ifrootis missing.openapi.yaml: Updated the schema to markrootasrequired: true.KnowledgeBase.md: Updated the documentation to reflect thatrootis 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
To prevent context window pollution, the
get_class_hierarchytool should not allow returning the entire ~1800 item class map. Agents must specify arootto narrow their query.Tasks:
ai/mcp/server/knowledge-base/services/QueryService.mjs:getClassHierarchyto throw an error ifrootis undefined or empty.ai/mcp/server/knowledge-base/openapi.yaml:rootparameter asrequired: true.Goal: Protect LLM context by enforcing scoped hierarchy queries.