This commit is contained in:
Timothy Jaeryang Baek
2026-03-07 17:29:24 -06:00
parent 7cdff6b1e2
commit bc5d519c4f

View File

@@ -1186,7 +1186,7 @@ async def get_tool_servers_data(servers: List[Dict[str, Any]]) -> List[Dict[str,
{
"id": str(id),
"idx": idx,
"url": server.get("url"),
"url": (server.get("url") or "").rstrip("/"),
"openapi": openapi_data,
"info": response.get("info"),
"specs": response.get("specs"),
@@ -1250,7 +1250,7 @@ async def execute_tool_server(
if params[param_name] is not None:
query_params[param_name] = params[param_name]
final_url = f"{url}{route_path}"
final_url = f"{url.rstrip('/')}{route_path}"
for key, value in path_params.items():
final_url = final_url.replace(f"{{{key}}}", str(value))
@@ -1320,6 +1320,8 @@ def get_tool_server_url(url: Optional[str], path: str) -> str:
if "://" in path:
# If it contains "://", it's a full URL
return path
if url:
url = url.rstrip("/")
if not path.startswith("/"):
# Ensure the path starts with a slash
path = f"/{path}"