MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getToolUseIDFromParentMessage

Function getToolUseIDFromParentMessage

source code/tools/utils.ts:32–42  ·  view source on GitHub ↗
(
  parentMessage: AssistantMessage,
  toolName: string,
)

Source from the content-addressed store, hash-verified

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

Callers 2

callFunction · 0.85
executeRemoteSkillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected