From f95d4c7a4e4637ea4364041da03a86e786cb4a88 Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Sat, 29 Aug 2026 01:13:33 +0800 Subject: [PATCH] fix: update link_capture_download and symbol_get tool descriptions for tickets The tool descriptions still advertised the removed "short-lived JWT" and gave no guidance against URL reconstruction. Align them with node_console's wording: run the returned curl_command verbatim, never rebuild the URL or copy the ticket by hand, re-call the tool once the 10-minute ticket has expired. --- gns3server/agent/mcp/__init__.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gns3server/agent/mcp/__init__.py b/gns3server/agent/mcp/__init__.py index 1caaa85fe..d6179d24b 100644 --- a/gns3server/agent/mcp/__init__.py +++ b/gns3server/agent/mcp/__init__.py @@ -1009,7 +1009,18 @@ async def link_capture_download( link_id: Annotated[str | None, Field(description="Link UUID (single mode)")] = None, link_ids: Annotated[list[str] | None, Field(description="Batch mode: [\"uuid1\",\"uuid2\"] — get download URLs for multiple captures")] = None, ) -> list[dict[str, Any]]: - """Get download URL(s) for PCAP capture file(s). The URL includes a short-lived JWT (10 min). Use curl to download.""" + """Get download command(s) for PCAP capture file(s). + + Returns a ready-to-run curl command per link with a short-lived access + ticket (10 min) already embedded in the URL. + + IMPORTANT — copy the returned values EXACTLY: + - Run each returned "curl_command" verbatim; it already contains the + full URL with ticket. NEVER construct or edit the URL yourself, and + NEVER copy the ticket by hand — a mistyped ticket is rejected. + - The ticket expires after 10 minutes: call this tool again to get a + fresh one; do not reuse an old URL. + """ params = {"project_id": project_id} if link_ids: params["link_ids"] = link_ids @@ -1299,7 +1310,13 @@ async def server_statistics() -> list[dict[str, Any]]: # async def symbol_get( # symbol_id: Annotated[str, Field(description="Symbol ID (e.g. ':/symbols/router.svg')")], # ) -> list[dict[str, Any]]: -# """Get a download URL for a symbol file (SVG). The URL includes a short-lived JWT (10 min). Use curl to download.""" +# """Get a download URL for a symbol file (SVG). +# +# Returns a ready-to-run curl command with a short-lived access ticket +# (10 min) embedded in the URL. Run the returned "curl_command" verbatim — +# never reconstruct the URL or copy the ticket by hand. Re-call this tool +# once the ticket has expired. +# """ # return await asyncio.to_thread(_run_handler_sync, get_symbol_handler, { # "symbol_id": symbol_id, # })