MCPcopy Create free account
hub / github.com/codeaashu/claude-code / hasToolUseWithIds

Function hasToolUseWithIds

src/services/compact/sessionMemoryCompact.ts:175–186  ·  view source on GitHub ↗

* Check if a message contains tool_use blocks with any of the given ids

(message: Message, toolUseIds: Set<string>)

Source from the content-addressed store, hash-verified

173 * Check if a message contains tool_use blocks with any of the given ids
174 */
175function hasToolUseWithIds(message: Message, toolUseIds: Set<string>): boolean {
176 if (message.type !== 'assistant') {
177 return false
178 }
179 const content = message.message.content
180 if (!Array.isArray(content)) {
181 return false
182 }
183 return content.some(
184 block => block.type === 'tool_use' && toolUseIds.has(block.id),
185 )
186}
187
188/**
189 * Adjust the start index to ensure we don't split tool_use/tool_result pairs

Callers 1

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected