Your LangChain Agent Returns Nothing. Let Your Coding Agent Read Its LangSmith Trace.
build··5 min read

Your LangChain Agent Returns Nothing. Let Your Coding Agent Read Its LangSmith Trace.

When a LangChain agent returns nothing, the cause is in its LangSmith trace. One fAI command lets every coding agent you use read that trace itself.

Michael Gearhardt

Your LangChain Agent Returns Nothing. Let Your Coding Agent Read Its LangSmith Trace.

Your LangChain or LangGraph agent runs and returns nothing: no output, no error in the log. The cause is usually in the LangSmith trace, not the log. LangSmith serves those traces over MCP (the Model Context Protocol, the standard way a coding agent connects to an outside tool), and one command can put that server in each coding agent you use, so the agent you are debugging with can read the failing run itself.


Why does my LangChain agent return an empty response with no error?

It is a common failure. LangGraph's own tracker has agents that return an empty final response and return nothing at all.

A lot of what breaks in an agent breaks inside the framework, while it builds the prompt or parses a tool call. That happens before your own logging sees anything, so the process looks healthy. The run still records what happened, and that record is the trace.


Could a stray { in your prompt be the cause?

Often, yes. LangChain reads {...} in a prompt template as a required input variable. Paste a JSON example, a code placeholder or a knowledge-base document into a prompt, and a literal brace becomes a variable with no value. Formatting fails at runtime, and the agent goes quiet.

LangChain documents this as INVALID_PROMPT_INPUT and tells you to debug it "by examining actual inputs to your prompt template by using LangSmith." It bites multi-agent and RAG setups hardest: one LangChain bug report notes that literal braces block "multi-agent systems that inject large knowledge bases into prompts."

We hit exactly this at Fathym. A literal { X, Y } in one of our own agent's prompts stopped its output, and the LangSmith trace was the only place the error showed.


How do I let every coding agent read my LangSmith traces?

Your app sends traces to LangSmith once you set LANGSMITH_TRACING=true and an API key, with no code change. LangSmith hosts an MCP server over those traces, its Remote MCP. Alongside its OAuth sign-in, it accepts a LangSmith API key in an X-Api-Key header. A header is something you can write into an agent's config, so an agent can connect without the sign-in step.

If Claude Code is the only agent you use, you don't need anything else. Claude Code adds the server itself:

claude mcp add --transport http langsmith https://api.smith.langchain.com/mcp --header "X-Api-Key: <your-langsmith-api-key>"

If you move between agents, each one keeps its MCP servers in its own file, in its own format, and you add LangSmith to each by hand. That is where fAI comes in. fAI is a session workbench: it runs under the AI coding tools you already use, captures your work across them and briefs them back. It also keeps their MCP configuration in step. You install the LangSmith MCP server once, and fAI writes it into every agent it supports on your machine, in each one's own format; fai mcp uninstall langsmith --global takes it back out of all of them. fAI works with sixteen agents, and eleven of them take MCP servers this way: Claude Code, Codex, Cursor, Copilot, Cline, Continue, Gemini, Goose, JetBrains AI, Windsurf and Antigravity.

Install fAI. On macOS or Linux:

curl -fsSL https://www.fathym.com/fai/install.sh | sh

On Windows:

iwr -useb https://www.fathym.com/fai/install.ps1 | iex

Then add LangSmith's Remote MCP to every agent:

fai mcp install https://api.smith.langchain.com/mcp --name langsmith --global --auth <your-langsmith-api-key> --auth-header X-Api-Key

--auth-header X-Api-Key sends your key under the header LangSmith expects instead of the default Authorization: Bearer. Without --global, fAI writes into the current project's config files (Claude Code's .mcp.json, for example), which often get committed, so it refuses a literal key there. --global writes each agent's user-level config instead, outside any repository. fAI also keeps the key in its own registry, ~/.fai/mcp-servers.json, likewise outside any repository; fai mcp uninstall removes it from there too. If your LangSmith account is in another region, use that region's Remote MCP URL from LangSmith's docs.


What does the agent do with it?

Ask it about the run. In Claude Code, Cursor, Copilot or any of the others, something like:

Fetch the last few root runs from my LangSmith project <your-project> and tell me why the latest one returned nothing.

The agent calls the server's tool for reading runs against that project and reads the run. For the stray-brace bug, the formatting error that never reached your log is in the trace.

A trace shows what happened, not whether the answer was right. For that, LangSmith's evaluations score your agent's outputs against datasets and criteria.


What if I run LangSmith myself?

On self-hosted LangSmith v0.15 or later, the same Remote MCP is served by your own instance at https://<your-langsmith-host>/api/mcp, and the install is the same command with that URL.

Older self-hosted versions use LangSmith's standalone MCP server, which LangSmith now marks deprecated and which authenticates with a LANGSMITH-API-KEY header instead. The install is the same command with --auth-header LANGSMITH-API-KEY and your server's /mcp URL.


Give your coding agent the trace

Install fAI, add LangSmith's Remote MCP once, and the next time an agent goes quiet, ask the agent you are working in to read the run.

fai mcp install https://api.smith.langchain.com/mcp --name langsmith --global --auth <your-langsmith-api-key> --auth-header X-Api-Key

Get started with fAI

Read more: See What Your AI Sees

Try it now
See what your AI sees.

Two commands. No config files, no API keys upfront.

deno run -A "https://www.fathym.com/fai/install.deno"
Get started free
Stay in the deep end.

Sign up for occasional emails on AI workbenches, developer ownership, and compounding intelligence.