feat: add MCP tool integration
This commit is contained in:
21
backend/services/tool_resources.py
Normal file
21
backend/services/tool_resources.py
Normal 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,
|
||||
)
|
||||
Reference in New Issue
Block a user