mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
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:
2 files changed
+1
-7
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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]:
|
||||
|
||||
Reference in new issue
Block a user