Skip to content

Commit 1e0c14f

Browse files
tae2089claude
andcommitted
fix: add depth=-1 test case and remove premature symbols mention in depth description
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3bffc20 commit 1e0c14f

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

internal/mcp/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func NewServer(deps *Deps) *server.MCPServer {
266266
Tool: mcp.NewTool("get_rag_tree",
267267
mcp.WithDescription("Get the RAG document tree for navigation. Call without arguments first to see all communities, then pass community_id to drill into a specific one."),
268268
mcp.WithString("community_id", mcp.Description("Community node ID as shown in the tree (e.g. 'community:auth'). Omit to get the full tree.")),
269-
mcp.WithNumber("depth", mcp.Description("Maximum tree depth to return (1=communities only, 2=communities+files, 3=including symbols). Default: 0 (unlimited).")),
269+
mcp.WithNumber("depth", mcp.Description("Maximum tree depth to return (1=communities only, 2=communities+files). Default: 0 (unlimited).")),
270270
),
271271
Handler: h.getRagTree,
272272
},

internal/ragindex/builder_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,14 @@ func TestPruneTree_NegativeDepth(t *testing.T) {
366366
},
367367
}
368368

369-
result := ragindex.PruneTree(root, 0)
370-
if len(result.Children) != 1 {
371-
t.Fatalf("expected 1 child, got %d", len(result.Children))
372-
}
373-
if len(result.Children[0].Children) != 1 {
374-
t.Fatalf("expected 1 grandchild at depth=0 (unlimited), got %d", len(result.Children[0].Children))
369+
for _, depth := range []int{0, -1} {
370+
result := ragindex.PruneTree(root, depth)
371+
if len(result.Children) != 1 {
372+
t.Fatalf("depth=%d: expected 1 child, got %d", depth, len(result.Children))
373+
}
374+
if len(result.Children[0].Children) != 1 {
375+
t.Fatalf("depth=%d: expected 1 grandchild (unlimited), got %d", depth, len(result.Children[0].Children))
376+
}
375377
}
376378
}
377379

0 commit comments

Comments
 (0)