diff --git a/src/fetch/src/mcp_server_fetch/server.py b/src/fetch/src/mcp_server_fetch/server.py index c1e1c88e..2a404ed3 100644 --- a/src/fetch/src/mcp_server_fetch/server.py +++ b/src/fetch/src/mcp_server_fetch/server.py @@ -89,7 +89,7 @@ async def check_may_autonomously_fetch_url(url: str, user_agent: str): ) -async def fetch_url(url: str, user_agent: str) -> (str, str): +async def fetch_url(url: str, user_agent: str, force_raw: bool = False) -> (str, str): """ Fetch the URL and return the content in a form ready for the LLM, as well as a prefix string with status information. """ @@ -111,7 +111,9 @@ async def fetch_url(url: str, user_agent: str) -> (str, str): page_raw = response.text content_type = response.headers.get("content-type", "") - if " args.max_length: content = content[args.start_index : args.start_index + args.max_length] content += f"\n\nContent truncated. Call the fetch tool with a start_index of {args.start_index + args.max_length} to get more content."