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
- Register Your First Prompt
- Add Arguments to a Prompt
- Return Messages, Not Just Text
- A Code-Review Prompt Template