MCPcopy Index your code
hub / github.com/codeaashu/claude-code / checkLargeToolResults

Function checkLargeToolResults

src/utils/contextSuggestions.ts:70–96  ·  view source on GitHub ↗
(
  data: ContextData,
  suggestions: ContextSuggestion[],
)

Source from the content-addressed store, hash-verified

68}
69
70function checkLargeToolResults(
71 data: ContextData,
72 suggestions: ContextSuggestion[],
73): void {
74 if (!data.messageBreakdown) return
75
76 for (const tool of data.messageBreakdown.toolCallsByType) {
77 const totalToolTokens = tool.callTokens + tool.resultTokens
78 const percent = (totalToolTokens / data.rawMaxTokens) * 100
79
80 if (
81 percent < LARGE_TOOL_RESULT_PERCENT ||
82 totalToolTokens < LARGE_TOOL_RESULT_TOKENS
83 ) {
84 continue
85 }
86
87 const suggestion = getLargeToolSuggestion(
88 tool.name,
89 totalToolTokens,
90 percent,
91 )
92 if (suggestion) {
93 suggestions.push(suggestion)
94 }
95 }
96}
97
98function getLargeToolSuggestion(
99 toolName: string,

Callers 1

Calls 2

getLargeToolSuggestionFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected