---
type: Glossary Term
title: "Sampling"
description: "Sampling (sampling/createMessage) is a client-exposed capability in the Model Context Protocol (MCP) that allows an MCP server to request an LLM completion from the host application rather than bundling its own model API keys."
resource: "https://agenticweb.wiki/terms/sampling/"
tags: ["glossary", "act"]
status: stable
generated: { by: agenticweb-builder/1.0, at: 2026-10-23T00:00:00Z }
verified: { by: process:agenticweb-engine, at: 2026-10-23T00:00:00Z }
stale_after: 2026-11-22T00:00:00Z
sources:
  - id: ref-1
    resource: "https://modelcontextprotocol.io/specification/2026-07-28/index"
    last_modified: 2026-07-28T00:00:00Z
---

# Sampling

**Sampling** (`sampling/createMessage`) is a client-exposed capability in the **Model Context Protocol (MCP)** that allows an MCP server to request an LLM completion from the host application rather than bundling its own model API keys. This keeps model selection, token billing, privacy guardrails, and human-in-the-loop approval under the control of the user's host while enabling recursive agentic behaviors inside MCP servers. Used by: mcp.

# Knowledge Graph

* **Related standards**: [Model Context Protocol](/okf/protocols/mcp.md)

[^ref-1]: https://modelcontextprotocol.io/specification/2026-07-28/index (https://modelcontextprotocol.io/specification/2026-07-28/index)
