Skip to content

Commit 5353b6b

Browse files
Remove JSON output to reduce token usage
The text format already provides all necessary information for LLMs to understand the issue graph. The redundant JSON output was adding significant token overhead without providing additional value. The text format includes: - Graph summary with focus node info and hierarchy - All nodes with type, state, title, and body preview - Parent/child relationships - Related issue connections
1 parent e15b16e commit 5353b6b

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

pkg/github/issue_graph.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package github
22

33
import (
44
"context"
5-
"encoding/json"
65
"fmt"
76
"regexp"
87
"sort"
@@ -923,18 +922,9 @@ Call this tool early when working on an issue to gather appropriate context abou
923922

924923
graph := crawler.buildGraph()
925924

926-
// Format for LLM consumption
925+
// Format for LLM consumption - text format is token-efficient and sufficient
927926
formattedOutput := formatGraphOutput(graph)
928927

929-
// Also include JSON for structured access
930-
jsonData, err := json.Marshal(graph)
931-
if err != nil {
932-
return nil, fmt.Errorf("failed to marshal graph: %w", err)
933-
}
934-
935-
// Return both human-readable and JSON format
936-
result := fmt.Sprintf("%s\n\nJSON_DATA:\n%s", formattedOutput, string(jsonData))
937-
938-
return mcp.NewToolResultText(result), nil
928+
return mcp.NewToolResultText(formattedOutput), nil
939929
}
940930
}

0 commit comments

Comments
 (0)