Register Your First Prompt
Decorate a function to publish a prompt.
Your First Prompt
Time to publish a prompt: a reusable, user-triggered template that starts a task with well-crafted wording every time. 💬
The Decorator
You turn a plain Python function into a prompt with the @mcp.prompt() decorator, just like you marked tools with @mcp.tool().
@mcp.prompt()
def greet() -> str:
return "Say hello warmly."All lessons in this course
- Register Your First Prompt
- Add Arguments to a Prompt
- Return Messages, Not Just Text
- A Code-Review Prompt Template