From ba0f6cd72db03492a1655adaa8f2f25717f0c972 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Mon, 12 Jan 2026 22:16:00 -0500 Subject: [PATCH] Fix decorator error messages to link to correct doc pages --- src/fastmcp/prompts/function_prompt.py | 2 +- src/fastmcp/server/providers/local_provider.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fastmcp/prompts/function_prompt.py b/src/fastmcp/prompts/function_prompt.py index fd5dbd50c0..eb8a53b3e3 100644 --- a/src/fastmcp/prompts/function_prompt.py +++ b/src/fastmcp/prompts/function_prompt.py @@ -387,7 +387,7 @@ def prompt( if isinstance(name_or_fn, classmethod): raise TypeError( "To decorate a classmethod, use @classmethod above @prompt. " - "See https://gofastmcp.com/servers/tools#using-with-methods" + "See https://gofastmcp.com/servers/prompts#using-with-methods" ) def create_prompt( diff --git a/src/fastmcp/server/providers/local_provider.py b/src/fastmcp/server/providers/local_provider.py index c47fa1f6b7..342e271b73 100644 --- a/src/fastmcp/server/providers/local_provider.py +++ b/src/fastmcp/server/providers/local_provider.py @@ -727,7 +727,7 @@ def decorator(fn: AnyFunction) -> Resource | ResourceTemplate | AnyFunction: f" ...\n\n" f" obj = MyClass()\n" f" mcp.add_resource(obj.{fn_name})\n\n" - f"See https://gofastmcp.com/servers/tools#using-with-methods" + f"See https://gofastmcp.com/servers/resources#using-with-methods" ) if fastmcp.settings.decorator_mode == "object": @@ -869,7 +869,7 @@ def my_prompt(data: str) -> list: if isinstance(name_or_fn, classmethod): raise TypeError( "To decorate a classmethod, use @classmethod above @prompt. " - "See https://gofastmcp.com/servers/tools#using-with-methods" + "See https://gofastmcp.com/servers/prompts#using-with-methods" ) def decorate_and_register( @@ -892,7 +892,7 @@ def decorate_and_register( f" ...\n\n" f" obj = MyClass()\n" f" mcp.add_prompt(obj.{fn_name})\n\n" - f"See https://gofastmcp.com/servers/tools#using-with-methods" + f"See https://gofastmcp.com/servers/prompts#using-with-methods" ) resolved_task: bool | TaskConfig = task if task is not None else False