When should you use sampling versus handling summarization on the client side?
MCP Advanced: Sampling, Server-to-Client LLM Requests, Cost Shifting Explained
Audio flashcard · 0:29Nortren·
When should you use sampling versus handling summarization on the client side?
0:29
Use sampling when your server performs complex data processing and needs AI-generated summaries, transformations, or analysis as an intermediate step before returning results. If the summarization is the final step that the client can handle directly with its own Claude call, sampling is unnecessary. Sampling shines when the server needs to combine fetched data with generated text internally, for example researching multiple sources and producing a unified report, before the final response reaches the user. It keeps the server's processing pipeline self-contained.
---
modelcontextprotocol.io