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

Function extractToolUseBlock

src/utils/permissions/classifierShared.ts:15–24  ·  view source on GitHub ↗
(
  content: BetaContentBlock[],
  toolName: string,
)

Source from the content-addressed store, hash-verified

13 * Extract tool use block from message content by tool name.
14 */
15export function extractToolUseBlock(
16 content: BetaContentBlock[],
17 toolName: string,
18): Extract<BetaContentBlock, { type: 'tool_use' }> | null {
19 const block = content.find(b => b.type === 'tool_use' && b.name === toolName)
20 if (!block || block.type !== 'tool_use') {
21 return null
22 }
23 return block
24}
25
26/**
27 * Parse and validate classifier response from tool use block.

Callers 1

classifyYoloActionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected