MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getToolUseInfo

Function getToolUseInfo

src/utils/groupToolUses.ts:34–46  ·  view source on GitHub ↗
(
  msg: MessageWithoutProgress,
)

Source from the content-addressed store, hash-verified

32}
33
34function getToolUseInfo(
35 msg: MessageWithoutProgress,
36): { messageId: string; toolUseId: string; toolName: string } | null {
37 if (msg.type === 'assistant' && msg.message.content[0]?.type === 'tool_use') {
38 const content = msg.message.content[0]
39 return {
40 messageId: msg.message.id,
41 toolUseId: content.id,
42 toolName: content.name,
43 }
44 }
45 return null
46}
47
48/**
49 * Groups tool uses by message.id (same API response) if the tool supports grouped rendering.

Callers 1

applyGroupingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected