Skip to content

Commit 53b8f7f

Browse files
committed
feat: save tools input schema
1 parent 00e4554 commit 53b8f7f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import json
23
import logging
34
import os
45
import sys
@@ -7,6 +8,7 @@
78
import uuid
89
from typing import Any, Dict, Optional
910

11+
from httpx import HTTPStatusError
1012
from mcp import ClientSession, StdioServerParameters, stdio_client
1113
from mcp.types import JSONRPCResponse
1214
from opentelemetry import trace
@@ -392,11 +394,12 @@ async def _register(self) -> None:
392394
"Name": tool.name,
393395
"ProcessType": "Tool",
394396
"Description": tool.description,
397+
"InputSchema": json.dumps(tool.inputSchema)
398+
if tool.inputSchema
399+
else "{}",
395400
}
396401
client_info["tools"].append(tool_info)
397402

398-
logger.info(client_info)
399-
400403
# Register with UiPath MCP Server
401404
await self._uipath.api_client.request_async(
402405
"POST",
@@ -407,8 +410,10 @@ async def _register(self) -> None:
407410
logger.info("Registered MCP Server type successfully")
408411
except Exception as e:
409412
logger.error(f"Error during registration: {e}")
410-
if e.status_code == 400:
411-
logger.error(f"Error details: {e.response.text}")
413+
if isinstance(e, HTTPStatusError):
414+
logger.error(
415+
f"HTTP error details: {e.response.text} status code: {e.response.status_code}"
416+
)
412417

413418
raise UiPathMcpRuntimeError(
414419
"REGISTRATION_ERROR",

0 commit comments

Comments
 (0)