MCPcopy Index your code
hub / github.com/codeaashu/claude-code / countToolUses

Function countToolUses

src/tools/AgentTool/agentToolUtils.ts:262–274  ·  view source on GitHub ↗
(messages: MessageType[])

Source from the content-addressed store, hash-verified

260export type AgentToolResult = z.input<ReturnType<typeof agentToolResultSchema>>
261
262export function countToolUses(messages: MessageType[]): number {
263 let count = 0
264 for (const m of messages) {
265 if (m.type === 'assistant') {
266 for (const block of m.message.content) {
267 if (block.type === 'tool_use') {
268 count++
269 }
270 }
271 }
272 }
273 return count
274}
275
276export function finalizeAgentTool(
277 agentMessages: MessageType[],

Callers 1

finalizeAgentToolFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected