Track external system calls triggered by LLM responses in your agentic endpoints. Tool calls represent interactions with external services, allowing you to monitor execution time and responses.
const toolCall = completion.choices[0].message.tool_calls[0]; const traceToolCall = trace.toolCall({ id: toolCall.id, name: toolCall.function.name, description: "Get current temperature for a given location.", args: toolCall.function.arguments, tags: { location: toolCall.function.arguments["location"] } }); try { const result = callExternalService(toolCall.function.name, toolCall.function.arguments); traceToolCall.result(result); } catch (error) { traceToolCall.error(error); }
Was this page helpful?