D2 · Tool Design & MCP › Cluster 6 · MCP Primitives

6.3 · Prompts (Reusable Templates)

User-controlled workflows

CONCEPT Prompts are the user-controlled primitive

An MCP server can expose prompt templates — pre-authored, structured message sequences that a user deliberately invokes to kick off a workflow. The defining property: prompts are user-controlled. The spec: prompts "are designed to be user-controlled, meaning they are exposed from servers to clients with the intention of the user being able to explicitly select them for use." Typically they surface as slash commands or menu items in the client UI.

A prompt can declare arguments to customize it. The client discovers prompts with prompts/list and, when the user picks one and fills in arguments, fetches the filled-in messages with prompts/get.

PrimitiveWho controls itTypical trigger
Prompt (6.3)User — explicitly selectsSlash command / menu item
Tool (6.1)Model — decides from contextModel emits a tools/call
Resource (6.2)Application — curates contextPicker / heuristic inclusion
🔑 The three primitives split cleanly by who is in control: Tools = model, Resources = application, Prompts = user. This "who-controls-what" triad is the single most tested idea in this cluster.

CONCEPT Arguments and returned messages

prompts/list returns each prompt's name, optional title/ description, and an arguments list (each with name, description, required). prompts/get then returns a messages array — each message has a role (user/assistant) and a content block (text, image, audio, or an embedded resource). So a prompt can weave server-side resources directly into the conversation it seeds.

A prompt is a reusable template: author it once, let users trigger it by name, and parameterize it with arguments — e.g. /code_review code=….

DIAGRAM List → user picks → get filled messages

sequenceDiagram participant User participant Client participant Server Note over Client,Server: Discovery Client->>Server: prompts/list Server-->>Client: [code_review {arguments}, ...] Note over User,Client: User-controlled selection User->>Client: /code_review (fills arguments) Note over Client,Server: Retrieval Client->>Server: prompts/get {name, arguments} Server-->>Client: {messages:[{role, content}]} Note over Client,Server: (optional) list changes Server--)Client: notifications/prompts/list_changed classDef srv fill:#d4edda,stroke:#28a745,color:#155724; classDef usr fill:#ffe8cc,stroke:#ff9f40,color:#9a4a0a; class Server srv; class User usr;

CODE A prompt definition and a get

The server advertises code_review with one required argument; when the user runs it, the client sends prompts/get and receives ready-to-send messages.

// prompts/list  → server advertises a reusable template
{
  "name": "code_review",
  "title": "Request Code Review",
  "description": "Analyze code quality and suggest improvements",
  "arguments": [
    { "name": "code", "description": "The code to review", "required": true }
  ]
}

// prompts/get  → user selected it (e.g. a slash command) + gave arguments
{ "method": "prompts/get",
  "params": { "name": "code_review",
              "arguments": { "code": "def hello(): print('world')" } } }

// result  → ready-to-send messages (role + content)
{ "messages": [ {
    "role": "user",
    "content": { "type": "text",
                 "text": "Please review this Python code:\ndef hello(): print('world')" }
} ] }

TRADE-OFFS Prompt vs. baking the workflow into a tool

✅ Prompt (user-controlled template)

  • User explicitly triggers — clear intent, discoverable as a command
  • Reusable, parameterized, can embed resources
  • Great for standardized, repeatable workflows

⚠️ Forcing it into a tool

  • Model decides when to run — user loses the explicit trigger
  • Harder to surface as a menu/slash command
  • Tools are for actions, not for seeding a conversation template

EXAM TRAPS

Trap: "Prompts are model-controlled." → No. Prompts are user-controlled — the user explicitly selects them, usually via a slash command or menu item.
Trap: Mixing up the methods. → Discover with prompts/list; fetch the filled-in template with prompts/get. There is no "prompts/call."
Trap: "Prompts can't take input." → They can declare arguments (with required), which the user supplies and prompts/get substitutes into the messages.
Trap: Assuming a prompt returns plain text only. → prompts/get returns a messages array with roles, and content can include embedded resources, images, or audio.

PRACTICE

Q1 · Who controls prompts, and how do they usually appear in the UI?

The user controls them — they explicitly select a prompt, most commonly surfaced as a slash command or menu item. This contrasts with model-controlled tools and application-controlled resources.

Q2 · What does prompts/get return, and how is it parameterized?

It returns a messages array (each with a role and content). It's parameterized by the arguments the prompt declared; the user supplies them and the server substitutes them into the messages.

Q3 · Give the who-controls-what triad for the three primitives.

Tools → model-controlled (LLM decides to call), Resources → application-controlled (host app curates context), Prompts → user-controlled (user explicitly selects a template).