mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-29 12:10:57 +00:00
backend: add mcp log type
This commit is contained in:
parent
6c822f1446
commit
afa27d443d
2 changed files with 10 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ from datetime import timedelta
|
|||
import json
|
||||
from python.helpers import errors
|
||||
from python.helpers import settings
|
||||
from python.helpers.log import LogItem
|
||||
|
||||
import httpx
|
||||
|
||||
|
|
@ -100,6 +101,14 @@ def initialize_mcp(mcp_servers_config: str):
|
|||
class MCPTool(Tool):
|
||||
"""MCP Tool wrapper"""
|
||||
|
||||
def get_log_object(self) -> LogItem:
|
||||
return self.agent.context.log.log(
|
||||
type="mcp",
|
||||
heading=f"icon://extension {self.agent.agent_name}: Using MCP tool '{self.name}'",
|
||||
content="",
|
||||
kvps={"tool_name": self.name, **self.args},
|
||||
)
|
||||
|
||||
async def execute(self, **kwargs: Any):
|
||||
error = ""
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue