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

Function countToolUses

src/utils/collapseReadSearch.ts:513–518  ·  view source on GitHub ↗

* Count the number of tool uses in a message (handles grouped tool uses).

(msg: RenderableMessage)

Source from the content-addressed store, hash-verified

511 * Count the number of tool uses in a message (handles grouped tool uses).
512 */
513function countToolUses(msg: RenderableMessage): number {
514 if (msg.type === 'grouped_tool_use') {
515 return msg.messages.length
516 }
517 return 1
518}
519
520/**
521 * Extract file paths from read tool inputs in a message.

Callers 1

collapseReadSearchGroupsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected