Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jackadamson committed Nov 22, 2024
1 parent 20a03e7 commit c08d2a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fetch/src/mcp_server_fetch/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ 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)
# TODO: after SDK bug is addressed, don't catch the exception
Expand Down

0 comments on commit c08d2a3

Please sign in to comment.