How do I see every tool call in an agent built with LangChain?
Rius records each tool call your LangChain agent makes as its own tool span, nested in the trace under the step that triggered it. Install the LangChain integration and call rius.init(), and tool calls, chains, retrievers and model calls arrive with no changes to your agent code. Open the trace to read the calls in the waterfall, or use the Spans tab to list every tool call across runs.
How it works
The LangChain integration hooks LangChain’s callback system, so anything that runs through it is traced: LCEL chains, agents and LangGraph nodes. Each step becomes one span, typed by what the step is:
- Tool invocations arrive as tool spans.
- Chains arrive as chain spans.
- Retrievers arrive as retriever spans.
- Model calls arrive as LLM spans with the model, token usage and messages. Rius computes the cost.
The nesting follows your chain structure, so a trace reads like your execution graph. A tool call sits under the chain or agent step that made it, next to the model call that chose it.
What the integration records on its own is everything that goes through LangChain’s callbacks. Work your agent does outside that path, such as a plain Python function you call directly or a step in code that does not use LangChain, has no callback to hook. Give that step a span of your own by wrapping it with observe, and it appears in the same trace. The integrations overview explains how the framework integrations and observe wrappers fit together.
Tool inputs and outputs are content attributes. If you turn off content capture, the tool spans still show their names, timing and errors, and the Input / Output tab says that content was not recorded.
Set it up
- Install the integration and start Rius. The extra installs the instrumentation, not LangChain itself.
pip install "glassflow-rius[langchain]" langchainimport rius
rius.init(api_key="ri_...", service_name="my-agent")
# build and run your chains exactly as beforeIn TypeScript, run npm install @arizeai/openinference-instrumentation-langchain. You also need @langchain/core, which a LangChain.js application already has. Then call init from @glassflow-ai/rius. The full setup is on the LangChain integration page.
- Run your agent and trigger at least one tool call.
- Open Traces in the console and click the run. In the waterfall, spans carry a kind badge (chain, llm, tool), so find the tool rows under the agent step that called them. Select a tool span and open Input / Output to read what the tool received and returned.
- To see tool calls across many runs, open the Spans tab, choose Tool in the All kinds menu, and sort by Time or Duration. Add filters for status or any attribute your agents send. Clicking a trace ID opens that trace with the span highlighted.
- If a step in your agent does not run through LangChain, wrap it with
observeso it gets a span of its own.
The exploring traces page covers the waterfall, filters and span inspector in full.
What you get
- A tool span for each tool call that goes through LangChain, placed under the step that made it.
- Failed tool calls highlighted along the path from the root to the error, with the exception and traceback in the detail panel. In the span panel,
]eand[ejump to the next and previous failed span. - Retries collapsed into one row such as
fetch_article · 3 attempts · recovered. Expand it to see each attempt. - A Spans tab filtered to the Tool kind, which lists every tool call across your runs.
- The Map tab, which shows the same trace as a graph with lenses for latency, cost, tokens and errors, so you can see which tool took the time.
- Model calls beside the tools, each with tokens and a list-price cost estimate in US dollars. A call is counted once in token and cost totals, and the LangChain span still shows the run’s total.
For the wider picture of running agents in production, see Monitor AI agents in production.
When something else fits
- If your tool calls run in code that LangChain’s callbacks never see, use
observewrappers for those steps rather than relying on the integration. - If you do not want tool inputs and outputs to leave your process, turn content capture off or apply a mask. You keep tool names, structure, timing and errors, but not the payloads.
- Text-completion models (
BaseLLMsubclasses) are still counted twice in token and cost totals, so check the LangChain integration page for which layer to keep.