From eac6c9f17d139bccc62322825ec00b22a19fcebf Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Sat, 6 Jun 2026 23:46:22 +0800 Subject: [PATCH] docs: improve MCP link tools filter parameter descriptions Updated the filters parameter description in create_link and update_link MCP tools to specify the required array format and provide examples. Changes: - Updated create_link filters description with array format requirements - Updated update_link filters description with array format and example - Added specific filter types: frequency_drop, packet_loss, delay, corrupt, bpf This helps users understand the correct format: - frequency_drop: [N] (drop every Nth packet) - packet_loss: [rate] (packet loss percentage) - delay: [ms, jitter] (latency and jitter in milliseconds) - corrupt: [rate] (packet corruption percentage) - bpf: [expression] (Berkeley Packet Filter) Prevents TypeError: 'int' object is not iterable errors. --- gns3server/api/routes/mcp/links.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gns3server/api/routes/mcp/links.py b/gns3server/api/routes/mcp/links.py index 32b203937..1d5a87da6 100644 --- a/gns3server/api/routes/mcp/links.py +++ b/gns3server/api/routes/mcp/links.py @@ -153,7 +153,10 @@ LINK_TOOLS = [ }, }, "link_type": {"type": "string", "description": "Link type: ethernet or serial (optional)"}, - "filters": {"type": "object", "description": "Packet filters (optional)"}, + "filters": { + "type": "object", + "description": "Packet filters (optional). Must use array format: frequency_drop: [N], packet_loss: [rate], delay: [ms, jitter], corrupt: [rate], bpf: [expression]" + }, }, "required": ["project_id", "nodes"], }, @@ -181,7 +184,10 @@ LINK_TOOLS = [ "project_id": {"type": "string", "description": "Project UUID"}, "link_id": {"type": "string", "description": "Link UUID"}, "suspend": {"type": "boolean", "description": "Suspend the link (optional)"}, - "filters": {"type": "object", "description": "Packet filters (optional)"}, + "filters": { + "type": "object", + "description": "Packet filters (optional). Must use array format: frequency_drop: [N], packet_loss: [rate], delay: [ms, jitter], corrupt: [rate], bpf: [expression]. Example: {\"frequency_drop\": [10], \"packet_loss\": [5]}" + }, }, "required": ["project_id", "link_id"], },