feat: add MCP tool integration

This commit is contained in:
Xin Wang
2026-07-18 00:00:06 +08:00
parent bdf3d3dd9c
commit e39bb48ba8
21 changed files with 1641 additions and 62 deletions

View File

@@ -0,0 +1,21 @@
"""Shared serialization helpers for reusable tool resources."""
from db.models import Tool
from schemas import ToolOut
from services.masking import mask_secrets
def tool_to_out(tool: Tool) -> ToolOut:
return ToolOut(
id=tool.id,
name=tool.name,
function_name=tool.function_name,
type=tool.type, # type: ignore[arg-type]
description=tool.description,
definition=tool.definition,
secrets=mask_secrets(tool.secrets or {}),
status=tool.status, # type: ignore[arg-type]
mcp_server_id=tool.mcp_server_id,
remote_tool_name=tool.remote_tool_name,
updated_at=tool.updated_at.isoformat() if tool.updated_at else None,
)