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

Function getToolUseIdsFromMessage

src/utils/collapseReadSearch.ts:452–468  ·  view source on GitHub ↗

* Get all tool use IDs from a single message (handles grouped tool uses).

(msg: RenderableMessage)

Source from the content-addressed store, hash-verified

450 * Get all tool use IDs from a single message (handles grouped tool uses).
451 */
452function getToolUseIdsFromMessage(msg: RenderableMessage): string[] {
453 if (msg.type === 'assistant') {
454 const content = msg.message.content[0]
455 if (content?.type === 'tool_use') {
456 return [content.id]
457 }
458 }
459 if (msg.type === 'grouped_tool_use') {
460 return msg.messages
461 .map(m => {
462 const content = m.message.content[0]
463 return content.type === 'tool_use' ? content.id : ''
464 })
465 .filter(Boolean)
466 }
467 return []
468}
469
470/**
471 * Get all tool use IDs from a collapsed read/search group.

Callers 2

collapseReadSearchGroupsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected