Skip to content

Commit 3178139

Browse files
authored
Merge pull request modelcontextprotocol#44 from modelcontextprotocol/davidsp/table
docs: add a table with an overview how propts,resources,tools,sampling is generally used
2 parents addad54 + 3973695 commit 3178139

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/spec/_index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ On top of the base protocol, MCP introduces these unique primitives:
3232
* **Tools**: functionality that the *client* can invoke on the *server*, to perform effectful operations. The client can choose to [expose these tools directly to the LLM](https://docs.anthropic.com/en/docs/build-with-claude/tool-use) too, allowing it to decide when and how to use them.
3333
* **Sampling**: *servers* can ask the *client* to sample from the LLM, which allows servers to implement agentic behaviors without having to implement sampling themselves. This also allows the client to combine the sampling request with *all of the other context it has*, making it much more intelligent—while avoiding needlessly exfiltrating information to servers.
3434

35+
Each primitive can be summarized in the following control hierarchy:
36+
37+
| Primitive | Control | Description | Example |
38+
|-----------|------------------------|----------------------------------------------------|------------------------------|
39+
| Prompts | User-controlled | Interactive templates invoked by user choice | Slash commands, menu options |
40+
| Resources | Application-controlled | Contextual data attached and managed by the client | File contents, git history |
41+
| Tools | Model-controlled | Functions exposed to the LLM to take actions | API POST requests, file writing |
42+
| Sampling | Server-initiated | LLM completion requests from server to client | Generating AI summaries |
43+
44+
The communication flow between client and server:
45+
3546
```mermaid
3647
flowchart LR
3748
server["Server\n<i>Script on local machine, web service, etc.</i>"]

0 commit comments

Comments
 (0)