MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / getToolUseIDFromParentMessage

Function getToolUseIDFromParentMessage

src/tools/utils.ts:30–40  ·  view source on GitHub ↗
(
  parentMessage: AssistantMessage,
  toolName: string,
)

Source from the content-addressed store, hash-verified

28 * Extracts the tool use ID from a parent message for a given tool name.
29 */
30export function getToolUseIDFromParentMessage(
31 parentMessage: AssistantMessage,
32 toolName: string,
33): string | undefined {
34 const toolUseBlock = parentMessage.message.content.find(
35 block => block.type === 'tool_use' && block.name === toolName,
36 )
37 return toolUseBlock && toolUseBlock.type === 'tool_use'
38 ? toolUseBlock.id
39 : undefined
40}

Callers 2

callFunction · 0.85
executeRemoteSkillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected