From 2547243038d8f9022a21bc73df26ee1721cfdb89 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Fri, 15 Aug 2025 11:33:36 -0400 Subject: [PATCH] fix: Use Message function and PromptResult type in docs (#1515) Co-authored-by: Claude --- docs/servers/prompts.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}"),