Example
Anatomy of a Prompt
When a client callsprompts/list, the server returns metadata for each prompt including its arguments. Here’s the JSON-RPC response that the example above produces when a client calls prompts/list:
Argument Descriptions
You can add descriptions to prompt arguments the same way as tools, usingAnnotated and Field:
description to each argument in the response:
Minimal Definition
At minimum, a prompt only needs a function:Using Context
Access the MCP context for advanced features. Add aContext parameter - it’s automatically excluded from the prompt’s arguments: