Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: Add Audio Content Support for MCP Tools (#27979)
Willaa4cabdeb5b9
diff --git a/api/core/tools/mcp_tool/tool.py b/api/core/tools/mcp_tool/tool.pyindex a476859f298..fbaf31ad091 100644--- a/api/core/tools/mcp_tool/tool.py+++ b/api/core/tools/mcp_tool/tool.py@@ -1,16 +1,19 @@import base64import json+import loggingfrom collections.abc import Generatorfrom typing import Anyfrom core.mcp.auth_client import MCPClientWithAuthRetryfrom core.mcp.error import MCPConnectionError-from core.mcp.types import CallToolResult, ImageContent, TextContent+from core.mcp.types import AudioContent, CallToolResult, ImageContent, TextContentfrom core.tools.__base.tool import Toolfrom core.tools.__base.tool_runtime import ToolRuntimefrom core.tools.entities.tool_entities import ToolEntity, ToolInvokeMessage, ToolProviderTypefrom core.tools.errors import ToolInvokeError+logger = logging.getLogger(__name__)+class MCPTool(Tool):def __init__(@@ -52,6 +55,11 @@ class MCPTool(Tool):yield from self._process_text_content(content)elif isinstance(content, ImageContent):yield self._process_image_content(content)+ elif isinstance(content, AudioContent):+ yield self._process_audio_content(content)+ else:+ logger.warning("Unsupported content type=%s", type(content))+# handle MCP structured outputif self.entity.output_schema and result.structuredContent:for k, v in result.structuredContent.items():@@ -97,6 +105,10 @@ class MCPTool(Tool):"""Process image content and return a blob message."""return self.create_blob_message(blob=base64.b64decode(content.data), meta={"mime_type": content.mimeType})+ def _process_audio_content(self, content: AudioContent) -> ToolInvokeMessage:+ """Process audio content and return a blob message."""+ return self.create_blob_message(blob=base64.b64decode(content.data), meta={"mime_type": content.mimeType})+def fork_tool_runtime(self, runtime: ToolRuntime) -> "MCPTool":return MCPTool(entity=self.entity,