fix: Remove unsupported description param from project_create

GNS3 REST API ProjectCreate schema does not have a description field.
The parameter was silently ignored; now removed to avoid confusion.
This commit is contained in:
YueGuobin 2026-06-10 23:32:27 +08:00
parent 80e64ebbae
commit 4ec80f8989
No known key found for this signature in database
2 changed files with 1 additions and 7 deletions

View File

@ -257,12 +257,9 @@ async def project_get(
@mcp.tool()
async def project_create(
name: Annotated[str, Field(description="Project name")],
description: Annotated[str, Field(description="Optional project description")] = "",
) -> list[dict[str, Any]]:
"""Create a new GNS3 project."""
params = {"name": name}
if description:
params["description"] = description
return await asyncio.to_thread(_run_handler_sync, create_project_handler, params)

View File

@ -66,10 +66,7 @@ def create_project_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) ->
if not name:
return {"error": "name is required"}
conn = _get_connector(gns3_ctx)
project_data = {"name": name}
if "description" in params:
project_data["description"] = params["description"]
return conn.http_call("post", f"{conn.base_url}/projects", json_data=project_data).json()
return conn.http_call("post", f"{conn.base_url}/projects", json_data={"name": name}).json()
def delete_project_handler(params: dict[str, Any], gns3_ctx: dict[str, Any]) -> dict[str, Any]: