Skip to content

Commit 9135cfa

Browse files
authored
Merge pull request #43 from UiPath/fix/samples
fix: return output
2 parents e7e699b + f335457 commit 9135cfa

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-mcp"
3-
version = "0.0.39"
3+
version = "0.0.40"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
106106
try:
107107
await session_server.cleanup()
108108
stderr_output = session_server.get_server_stderr()
109-
logger.info(f"stderr_output: {stderr_output}")
110109
if stderr_output:
111110
session_outputs[session_id] = stderr_output
112111
except Exception as e:
@@ -121,10 +120,9 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
121120
# If there are multiple sessions, use the sessionId as the key
122121
output_result = session_outputs
123122

124-
logger.info(f"Output: {output_result}")
125-
self.result = UiPathRuntimeResult(output=output_result)
126-
logger.info(f"Result: {self.result.model_dump_json()}")
127-
return self.result
123+
self.context.result = UiPathRuntimeResult(output=output_result)
124+
125+
return self.context.result
128126

129127
except Exception as e:
130128
if isinstance(e, UiPathMcpRuntimeError):

src/uipath_mcp/_cli/_runtime/_session.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ async def _run_server(self, server_params: StdioServerParameters) -> None:
102102
finally:
103103
stderr_temp.seek(0)
104104
self._server_stderr_output = stderr_temp.read()
105-
logger.info(
106-
f"Session {self.session_id} - Server stderr output:\n{self._server_stderr_output}"
107-
)
108105
# The context managers will handle cleanup of resources
109106
logger.info(f"Server process for session {self.session_id} has ended")
110107
self.read_stream = None

src/uipath_mcp/_cli/_runtime/_tracer.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,9 @@ def create_span_for_message(self, message: types.JSONRPCMessage, **context) -> S
5353
span.set_attribute("type", "response")
5454
span.set_attribute("span_type", "MCP response")
5555
span.set_attribute("id", str(root_value.id))
56-
if isinstance(root_value.result, dict):
57-
parent_span.set_attribute("output", json.dumps(root_value.result))
56+
#if isinstance(root_value.result, dict):
57+
#parent_span.set_attribute("output", json.dumps(root_value.result))
5858
self._add_response_attributes(span, root_value)
59-
parent_span.add_event(
60-
"response",
61-
{"output": json.dumps(root_value.result)}
62-
)
63-
parent_span.end()
6459
else: # JSONRPCError
6560
span = self.tracer.start_span("error", context=span_context)
6661
span.set_attribute("type", "error")

0 commit comments

Comments
 (0)