diff --git a/trustgraph-base/trustgraph/base/tool_service.py b/trustgraph-base/trustgraph/base/tool_service.py index e32bb6a3..4f63bc53 100644 --- a/trustgraph-base/trustgraph/base/tool_service.py +++ b/trustgraph-base/trustgraph/base/tool_service.py @@ -81,7 +81,7 @@ class ToolService(FlowProcessor): ) __class__.tool_invocation_metric.labels( - id = self.id, flow = self.flow, name = request.name, + id = self.id, flow = flow.name, name = request.name, ).inc() except TooManyRequests as e: diff --git a/trustgraph-flow/trustgraph/agent/mcp_tool/service.py b/trustgraph-flow/trustgraph/agent/mcp_tool/service.py index 97e37a0b..8f086a5a 100755 --- a/trustgraph-flow/trustgraph/agent/mcp_tool/service.py +++ b/trustgraph-flow/trustgraph/agent/mcp_tool/service.py @@ -44,10 +44,17 @@ class Service(ToolService): ) print(result) + if result.structuredContent: return result.structuredContent + elif hasattr(result, "content"): + return "".join([ + x.text + for x in result.content + ]) else: - return result.unstructuredContent + return "No content" + except BaseExceptionGroup as e: for child in e.exceptions: