mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-10-18 05:48:00 +00:00
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:
@@ -67,7 +67,10 @@ func (s *Server) resolveASTQueryParams(request mcp.CallToolRequest) (*astQueryPa
|
||||
if prefsFormat != "" {
|
||||
p.format = prefsFormat
|
||||
} else {
|
||||
p.format = "verbose"
|
||||
// Default to compact (one line per match): far fewer tokens than
|
||||
// verbose (full code + captures) on multi-match queries. Callers can
|
||||
// opt into verbose per-call or via the default_format session pref.
|
||||
p.format = "compact"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user