@@ -2,6 +2,7 @@ package tools
22
33import (
44 "context"
5+ "os"
56 "strings"
67)
78
@@ -56,12 +57,14 @@ func GetModelNameFromContext(ctx context.Context) string {
5657 return getContextValue(ctx, ModelNameContextKey, "")
5758}
5859
59−// FirstLineDescription returns the first non-empty line from the embedded
60−// markdown description. This extracts just the concise summary line,
61−// significantly reducing token usage while preserving essential tool context.
60+// FirstLineDescription returns just the first non-empty line from the embedded
61+// markdown description when CRUSH_SHORT_TOOL_DESCRIPTIONS is set, significantly
62+// reducing token usage. Otherwise returns the full description.
6263func FirstLineDescription(content []byte) string {
63− lines := strings.SplitSeq(string(content), "\n")
64− for line := range lines {
64+ if os.Getenv("CRUSH_SHORT_TOOL_DESCRIPTIONS") == "" {
65+ return strings.TrimSpace(string(content))
66+ }
67+ for line := range strings.SplitSeq(string(content), "\n") {
6568 line = strings.TrimSpace(line)
6669 if line != "" {
6770 return line