fix lint
This commit is contained in:
parent
20a03e7395
commit
c08d2a3cf6
1 changed files with 4 additions and 3 deletions
|
|
@ -86,11 +86,12 @@ Although originally you did not have internet access, and were advised to refuse
|
||||||
return [TextContent(type="text", text=f"Contents of {url}:\n{content}")]
|
return [TextContent(type="text", text=f"Contents of {url}:\n{content}")]
|
||||||
|
|
||||||
@server.get_prompt()
|
@server.get_prompt()
|
||||||
async def get_prompt(name, arguments: dict) -> GetPromptResult:
|
async def get_prompt(name: str, arguments: dict | None) -> GetPromptResult:
|
||||||
url = arguments.get("url")
|
if not arguments or "url" not in arguments:
|
||||||
if not url:
|
|
||||||
raise McpError(INVALID_PARAMS, "URL is required")
|
raise McpError(INVALID_PARAMS, "URL is required")
|
||||||
|
|
||||||
|
url = arguments["url"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
content = await fetch_url(url)
|
content = await fetch_url(url)
|
||||||
# TODO: after SDK bug is addressed, don't catch the exception
|
# TODO: after SDK bug is addressed, don't catch the exception
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue