MCP Academy · Lesson

Add Arguments to a Prompt

Let users fill in slots before the prompt runs.

Fillable Slots

A static prompt is fine, but real power comes from arguments: blanks the user fills in before the prompt runs. 🧩

Parameters Become Arguments

Each function parameter becomes a prompt argument. The host shows an input field for every one and collects the values.

@mcp.prompt()
def summarize(text: str) -> str:
    return f"Summarize this:\n{text}"

All lessons in this course

  1. Register Your First Prompt
  2. Add Arguments to a Prompt
  3. Return Messages, Not Just Text
  4. A Code-Review Prompt Template
← Back to MCP Academy