MCPcopy Create free account
hub / github.com/OperationT00/T-Code / executeToolCalls

Method executeToolCalls

src/main/java/com/tcode/agent/Agent.java:594–613  ·  view source on GitHub ↗
(List<LlmClient.ToolCall> toolCalls, int iteration)

Source from the content-addressed store, hash-verified

592 }
593
594 private List<ToolExecutionResult> executeToolCalls(List<LlmClient.ToolCall> toolCalls, int iteration) {
595 List<ToolInvocation> invocations = new ArrayList<>();
596 for (LlmClient.ToolCall toolCall : toolCalls) {
597 String toolName = toolCall.function().name();
598 String toolArgs = toolCall.function().arguments();
599 log.info("Scheduling tool: {} (iteration={})", toolName, iteration);
600 log.debug("Tool args [{}]: {}", toolName, toolArgs);
601 invocations.add(new ToolInvocation(toolCall.id(), toolName, toolArgs));
602 }
603
604 if (invocations.size() > 1) {
605 log.info("Executing {} tool calls in parallel (iteration={})", invocations.size(), iteration);
606 }
607 List<ToolExecutionResult> results = toolRegistry.executeTools(invocations);
608 for (ToolExecutionResult result : results) {
609 log.debug("Tool result preview [{}]: {}", result.name(), preview(result.result(), 300));
610 emitToolResultSummary(result);
611 }
612 return results;
613 }
614
615 private void emitToolResultSummary(ToolExecutionResult result) {
616 if (result == null || result.name() == null) {

Callers 1

runMethod · 0.95

Calls 7

previewMethod · 0.95
emitToolResultSummaryMethod · 0.95
addMethod · 0.80
executeToolsMethod · 0.80
resultMethod · 0.80
nameMethod · 0.65
sizeMethod · 0.65

Tested by

no test coverage detected