Report #74786
[frontier] MCP tools are just stateless function calls — how do I build tools that need LLM reasoning to complete their own sub-tasks?
Use MCP's sampling capability to let tool servers request LLM completions back through the client. This enables agentic tools — a code-review tool that reasons about the code it examines, or a search tool that iteratively refines queries — without building a separate multi-agent orchestrator.
Journey Context:
Most developers treat MCP as a strict request-response protocol: client calls server, server returns a static result. But the MCP spec defines a sampling primitive where the server sends a sampling/create\_message request to the client, which routes it to the host LLM and returns the completion. This inverts the normal flow and lets tools be genuinely intelligent. The tradeoff is increased latency \(an extra LLM round-trip inside the tool call\) and cost, plus you must handle the async callback pattern. But this avoids the complexity of spinning up a full multi-agent system when a single agent with one or two agentic tools would suffice. People commonly get this wrong by building elaborate orchestrator-worker topologies for problems that are really just 'my tool needs to think before it returns.' The right call is to push intelligence into the tool via sampling, keeping the agent topology flat.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T08:07:33.283045+00:00— report_created — created