Use the toolCall method on a trace or span to create a tool call log entry. Provide the tool call ID, name, description, and arguments:
JavaScript/TypeScript:
Python:
Recording Results and Errors
After executing the tool, record the outcome using result() for successful executions or error() for failures:
JavaScript/TypeScript:
Python:
Both result() and error() automatically end the tool call and record the completion timestamp.
You can enrich tool calls with additional context:
All logged tool calls appear in the Maxim dashboard as part of the trace visualization. You can:
- View the complete execution flow including tool call arguments and results
- Debug failed tool calls by examining error details
- Analyze tool call latency and performance
- Filter traces by tool call success or failure
If you’re using agent frameworks like LangChain, LlamaIndex, or OpenAI Agents SDK with Maxim’s instrumentation, tool calls are automatically logged without manual instrumentation. The SDK captures tool invocations, arguments, results, and errors as part of the agent trace.