diff --git a/docs/servers/prompts.mdx b/docs/servers/prompts.mdx index 1d512d98d..c57ed571b 100644 --- a/docs/servers/prompts.mdx +++ b/docs/servers/prompts.mdx @@ -188,10 +188,10 @@ FastMCP intelligently handles different return types from your prompt function: - **`Any`**: If the return type is not one of the above, the return value is attempted to be converted to a string and used as a `PromptMessage`. ```python -from fastmcp.prompts.prompt import PromptMessage +from fastmcp.prompts.prompt import Message, PromptResult @mcp.prompt -def roleplay_scenario(character: str, situation: str) -> list[PromptMessage]: +def roleplay_scenario(character: str, situation: str) -> PromptResult: """Sets up a roleplaying scenario with initial messages.""" return [ Message(f"Let's roleplay. You are {character}. The situation is: {situation}"),