MemotivaMCP Advanced: Sampling, Server-to-Client LLM Requests, Cost Shifting Explained

What is the difference between sampling and direct tool use in MCP?

MCP Advanced: Sampling, Server-to-Client LLM Requests, Cost Shifting Explained

Audio flashcard · 0:29

Nortren·

What is the difference between sampling and direct tool use in MCP?

0:29

Direct tool use means the client calls Claude, Claude decides to use a server tool, the server executes it and returns data, and Claude generates the final response. Sampling reverses one part of this flow. During tool execution, the server itself needs language model help to process intermediate results, so it asks the client to call Claude on its behalf. The key difference is direction: in tool use, the client initiates the model call. In sampling, the server initiates a model call through the client. Sampling is a server-to-client request for AI generation.
modelcontextprotocol.io