feat(ast_query): default to compact format for token efficiency

ast_query defaulted to verbose output (full code + up to 500 chars/match + captures), which is very token-heavy on multi-match queries. Default to compact (one line per match: file:line (kind) firstline) — roughly 5-10x fewer tokens on typical queries — while verbose remains available per-call (format=verbose) or via the default_format session pref. Updates tool description, help resource, and TestASTQueryFormatCompactDefault.
This commit is contained in:
2026-06-20 00:33:32 +01:00
parent b2c4101b5b
commit dfd68f08c9
4 changed files with 24 additions and 10 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ func (s *Server) registerTools() {
mcp.Description("Maximum number of results to return (default: 100, page size for pagination)"),
),
mcp.WithString("format",
mcp.Description("Output format: \"verbose\" (default, full code+captures), \"compact\" (one line per match), \"location\" (file:line only)"),
mcp.Description("Output format: \"compact\" (default, one line per match), \"verbose\" (full code+captures), \"location\" (file:line only)"),
),
mcp.WithString("cursor",
mcp.Description("Pagination cursor from a previous truncated response. Pass back to fetch the next page."),