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