diff --git a/src/fetch/src/mcp_server_fetch/server.py b/src/fetch/src/mcp_server_fetch/server.py index afcf2ed8..e8793a78 100644 --- a/src/fetch/src/mcp_server_fetch/server.py +++ b/src/fetch/src/mcp_server_fetch/server.py @@ -86,10 +86,11 @@ async def call_tool(name, arguments: dict) -> list[TextContent]: return [TextContent(type="text", text=f"Contents of {url}:\n{content}")] @server.get_prompt() - async def get_prompt(name, arguments: dict) -> GetPromptResult: - url = arguments.get("url") - if not url: + async def get_prompt(name: str, arguments: dict | None) -> GetPromptResult: + if not arguments or "url" not in arguments: raise McpError(INVALID_PARAMS, "URL is required") + + url = arguments["url"] try: content = await fetch_url(url)