MCPcopy
hub / github.com/codeaashu/claude-code / getToolUseIDs

Function getToolUseIDs

src/utils/messages.ts:1461–1474  ·  view source on GitHub ↗
(
  normalizedMessages: NormalizedMessage[],
)

Source from the content-addressed store, hash-verified

1459}
1460
1461export function getToolUseIDs(
1462 normalizedMessages: NormalizedMessage[],
1463): Set<string> {
1464 return new Set(
1465 normalizedMessages
1466 .filter(
1467 (_): _ is NormalizedAssistantMessage<BetaToolUseBlock> =>
1468 _.type === 'assistant' &&
1469 Array.isArray(_.message.content) &&
1470 _.message.content[0]?.type === 'tool_use',
1471 )
1472 .map(_ => _.message.content[0].id),
1473 )
1474}
1475
1476/**
1477 * Reorders messages so that attachments bubble up until they hit either:

Callers 1

MessagesImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected