From 26fd18b6b840c025dcd29b3be3779459cceb644e Mon Sep 17 00:00:00 2001 From: Saumya Date: Wed, 30 Jul 2025 11:37:34 +0530 Subject: [PATCH] cleanup agent builder tools --- backend/agent/agent_builder_prompt.py | 1 - backend/agent/prompt.py | 1 - backend/pipedream/facade.py | 13 +- .../agents/config/[agentId]/page.tsx | 9 +- .../agents/config/configuration-tab.tsx | 2 +- .../thread/content/ThreadContent.tsx | 24 +- .../thread/tool-call-side-panel.tsx | 19 - .../tool-views/mcp-tool/McpToolView.tsx | 288 -------------- .../thread/tool-views/mcp-tool/_utils.ts | 354 ------------------ .../tool-views/wrapper/ToolViewRegistry.tsx | 2 - frontend/src/components/thread/utils.ts | 6 - .../versioning/services/version-service.ts | 4 - 12 files changed, 9 insertions(+), 714 deletions(-) delete mode 100644 frontend/src/components/thread/tool-views/mcp-tool/McpToolView.tsx delete mode 100644 frontend/src/components/thread/tool-views/mcp-tool/_utils.ts diff --git a/backend/agent/agent_builder_prompt.py b/backend/agent/agent_builder_prompt.py index 8ef09da1..83fa43a2 100644 --- a/backend/agent/agent_builder_prompt.py +++ b/backend/agent/agent_builder_prompt.py @@ -45,7 +45,6 @@ Connect your agent to the world: - **`search_mcp_servers`**: Find integrations by keyword (Gmail, Slack, databases, etc.) - **`get_popular_mcp_servers`**: Browse trending, well-tested integrations - **`get_mcp_server_tools`**: Explore what each integration can do -- **`configure_mcp_server`**: Set up and connect external services - **`test_mcp_server_connection`**: Verify everything works perfectly ### 🔐 Credential Profile Management diff --git a/backend/agent/prompt.py b/backend/agent/prompt.py index c9bddc9d..303e3db8 100644 --- a/backend/agent/prompt.py +++ b/backend/agent/prompt.py @@ -672,7 +672,6 @@ You have the ability to configure and enhance yourself! When users ask you to mo - `search_mcp_servers`: Find integrations for specific services (Gmail, Slack, GitHub, etc.) - `get_popular_mcp_servers`: Browse trending integrations - `get_mcp_server_tools`: Explore integration capabilities -- `configure_mcp_server`: Set up external service connections ### Credential Management - `create_credential_profile`: Set up secure connections to external services diff --git a/backend/pipedream/facade.py b/backend/pipedream/facade.py index 5f35bc0f..47efbe2c 100644 --- a/backend/pipedream/facade.py +++ b/backend/pipedream/facade.py @@ -397,14 +397,11 @@ class PipedreamManager: print(f"[DEBUG] After deepcopy - updated_custom_mcps count: {len(updated_custom_mcps)}") print(f"[DEBUG] After deepcopy - updated_custom_mcps: {updated_custom_mcps}") - # Normalize enabledTools vs enabled_tools for mcp in updated_custom_mcps: - if 'enabled_tools' in mcp and 'enabledTools' not in mcp: - mcp['enabledTools'] = mcp['enabled_tools'] - elif 'enabledTools' not in mcp and 'enabled_tools' not in mcp: - mcp['enabledTools'] = [] + if 'enabledTools' not in mcp: + mcp['enabledTools'] = mcp.get('enabled_tools', []) + - # Look for existing MCP with same profile_id found_match = False for i, mcp in enumerate(updated_custom_mcps): print(f"[DEBUG] Checking MCP {i}: type={mcp.get('type')}, profile_id={mcp.get('config', {}).get('profile_id')}") @@ -412,7 +409,6 @@ class PipedreamManager: mcp.get('config', {}).get('profile_id') == profile_id): print(f"[DEBUG] Found existing MCP at index {i}, updating tools from {mcp.get('enabledTools', [])} to {enabled_tools}") mcp['enabledTools'] = enabled_tools - mcp['enabled_tools'] = enabled_tools found_match = True break @@ -428,8 +424,7 @@ class PipedreamManager: }, "profile_id": profile_id }, - "enabledTools": enabled_tools, - "enabled_tools": enabled_tools + "enabledTools": enabled_tools } print(f"[DEBUG] New MCP config: {new_mcp_config}") updated_custom_mcps.append(new_mcp_config) diff --git a/frontend/src/app/(dashboard)/agents/config/[agentId]/page.tsx b/frontend/src/app/(dashboard)/agents/config/[agentId]/page.tsx index 475ff29a..9407e6c9 100644 --- a/frontend/src/app/(dashboard)/agents/config/[agentId]/page.tsx +++ b/frontend/src/app/(dashboard)/agents/config/[agentId]/page.tsx @@ -113,12 +113,7 @@ export default function AgentConfigurationPage() { }); return; } - if (restrictions.system_prompt_editable === false && formData.system_prompt !== originalData.system_prompt) { - toast.error("Cannot save changes", { - description: "Suna's system prompt cannot be modified.", - }); - return; - } + if (restrictions.tools_editable === false && JSON.stringify(formData.agentpress_tools) !== JSON.stringify(originalData.agentpress_tools)) { toast.error("Cannot save changes", { description: "Suna's default tools cannot be modified.", @@ -138,7 +133,7 @@ export default function AgentConfigurationPage() { const newVersion = await createVersionMutation.mutateAsync({ agentId, data: { - system_prompt: formData.system_prompt, + system_prompt: isSunaAgent ? '' : formData.system_prompt, configured_mcps: formData.configured_mcps, custom_mcps: normalizedCustomMcps, agentpress_tools: formData.agentpress_tools, diff --git a/frontend/src/components/agents/config/configuration-tab.tsx b/frontend/src/components/agents/config/configuration-tab.tsx index 4411cdb7..c3673ec6 100644 --- a/frontend/src/components/agents/config/configuration-tab.tsx +++ b/frontend/src/components/agents/config/configuration-tab.tsx @@ -60,7 +60,7 @@ export function ConfigurationTab({ const isSunaAgent = agentMetadata?.is_suna_default || false; const mapAccordion = (val?: string) => { - if (val === 'instructions') return 'system'; + if (val === 'instructions') return isSunaAgent ? 'integrations' : 'system'; if (isSunaAgent && (val === 'system' || val === 'tools')) { return 'integrations'; } diff --git a/frontend/src/components/thread/content/ThreadContent.tsx b/frontend/src/components/thread/content/ThreadContent.tsx index f2a8f81f..3bb6d1d4 100644 --- a/frontend/src/components/thread/content/ThreadContent.tsx +++ b/frontend/src/components/thread/content/ThreadContent.tsx @@ -1,10 +1,9 @@ import React, { useRef, useState, useCallback } from 'react'; import { ArrowDown, CircleDashed, CheckCircle, AlertTriangle } from 'lucide-react'; import { Button } from '@/components/ui/button'; -import { Markdown } from '@/components/ui/markdown'; import { UnifiedMessage, ParsedContent, ParsedMetadata } from '@/components/thread/types'; import { FileAttachmentGrid } from '@/components/thread/file-attachment'; -import { useFilePreloader, FileCache } from '@/hooks/react-query/files'; +import { useFilePreloader } from '@/hooks/react-query/files'; import { useAuth } from '@/components/AuthProvider'; import { Project } from '@/lib/api'; import { @@ -13,13 +12,10 @@ import { getUserFriendlyToolName, safeJsonParse, } from '@/components/thread/utils'; -import { formatMCPToolDisplayName } from '@/components/thread/tool-views/mcp-tool/_utils'; import { KortixLogo } from '@/components/sidebar/kortix-logo'; import { AgentLoader } from './loader'; -import { parseXmlToolCalls, isNewXmlFormat, extractToolNameFromStream } from '@/components/thread/tool-views/xml-parser'; -import { parseToolResult } from '@/components/thread/tool-views/tool-result-parser'; +import { parseXmlToolCalls, isNewXmlFormat } from '@/components/thread/tool-views/xml-parser'; import { ShowToolStream } from './ShowToolStream'; -import { PipedreamConnectButton } from './pipedream-connect-button'; import { PipedreamUrlDetector } from './pipedream-url-detector'; const HIDE_STREAMING_XML_TAGS = new Set([ @@ -56,22 +52,6 @@ const HIDE_STREAMING_XML_TAGS = new Set([ 'execute-data-provider-endpoint', ]); -function getEnhancedToolDisplayName(toolName: string, rawXml?: string): string { - if (toolName === 'call-mcp-tool' && rawXml) { - const toolNameMatch = rawXml.match(/tool_name="([^"]+)"/); - if (toolNameMatch) { - const fullToolName = toolNameMatch[1]; - const parts = fullToolName.split('_'); - if (parts.length >= 3 && fullToolName.startsWith('mcp_')) { - const serverName = parts[1]; - const toolNamePart = parts.slice(2).join('_'); - return formatMCPToolDisplayName(serverName, toolNamePart); - } - } - } - return getUserFriendlyToolName(toolName); -} - // Helper function to render attachments (keeping original implementation for now) export function renderAttachments(attachments: string[], fileViewerHandler?: (filePath?: string, filePathList?: string[]) => void, sandboxId?: string, project?: Project) { if (!attachments || attachments.length === 0) return null; diff --git a/frontend/src/components/thread/tool-call-side-panel.tsx b/frontend/src/components/thread/tool-call-side-panel.tsx index f1625e87..dc0907ea 100644 --- a/frontend/src/components/thread/tool-call-side-panel.tsx +++ b/frontend/src/components/thread/tool-call-side-panel.tsx @@ -157,25 +157,6 @@ export function ToolCallSidePanel({ const currentToolCall = currentSnapshot?.toolCall; const totalCalls = toolCallSnapshots.length; - const extractToolName = (toolCall: any) => { - const rawName = toolCall?.assistantCall?.name || 'Tool Call'; - if (rawName === 'call-mcp-tool') { - const assistantContent = toolCall?.assistantCall?.content; - if (assistantContent) { - try { - const toolNameMatch = assistantContent.match(/tool_name="([^"]+)"/); - if (toolNameMatch && toolNameMatch[1]) { - const mcpToolName = toolNameMatch[1]; - return getUserFriendlyToolName(mcpToolName); - } - } catch (e) { - } - } - return 'External Tool'; - } - return getUserFriendlyToolName(rawName); - }; - const completedToolCalls = toolCallSnapshots.filter(snapshot => snapshot.toolCall.toolResult?.content && snapshot.toolCall.toolResult.content !== 'STREAMING' diff --git a/frontend/src/components/thread/tool-views/mcp-tool/McpToolView.tsx b/frontend/src/components/thread/tool-views/mcp-tool/McpToolView.tsx deleted file mode 100644 index f76bfbf2..00000000 --- a/frontend/src/components/thread/tool-views/mcp-tool/McpToolView.tsx +++ /dev/null @@ -1,288 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { - PlugIcon, - CheckCircle, - AlertTriangle, - Loader2, - ChevronDown, - ChevronUp, - Zap, - Clock, - Settings, -} from 'lucide-react'; -import { ToolViewProps } from '../types'; -import { cn } from '@/lib/utils'; -import { useTheme } from 'next-themes'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Badge } from '@/components/ui/badge'; -import { Progress } from '@/components/ui/progress'; -import { ScrollArea } from "@/components/ui/scroll-area"; -import { formatTimestamp } from '../utils'; -import { detectMCPFormat } from '../mcp-format-detector'; -import { MCPContentRenderer } from '../mcp-content-renderer'; -import { - parseMCPResult, - parseMCPToolCall, - getMCPServerIcon, - getMCPServerColor, - formatMCPToolDisplayName, - MCPResult, - ParsedMCPTool -} from './_utils'; - -export function McpToolView({ - name = 'call-mcp-tool', - assistantContent, - toolContent, - assistantTimestamp, - toolTimestamp, - isSuccess = true, - isStreaming = false, -}: ToolViewProps) { - const { resolvedTheme } = useTheme(); - const [progress, setProgress] = useState(0); - const [expandedArgs, setExpandedArgs] = useState(false); - const [expandedResult, setExpandedResult] = useState(false); - - const parsedTool = parseMCPToolCall(assistantContent || ''); - const result = toolContent ? parseMCPResult(toolContent) : null; - - const serverName = result?.mcp_metadata?.server_name || parsedTool.serverName; - const toolName = result?.mcp_metadata?.tool_name || parsedTool.toolName; - const fullToolName = result?.mcp_metadata?.full_tool_name || parsedTool.fullToolName; - const argumentsCount = result?.mcp_metadata?.arguments_count ?? Object.keys(parsedTool.arguments).length; - - const displayName = result?.mcp_metadata ? - formatMCPToolDisplayName(serverName, toolName) : - parsedTool.displayName; - - const ServerIcon = getMCPServerIcon(serverName); - const serverColor = getMCPServerColor(serverName); - - useEffect(() => { - if (isStreaming) { - const timer = setInterval(() => { - setProgress((prevProgress) => { - if (prevProgress >= 95) { - clearInterval(timer); - return prevProgress; - } - return prevProgress + 8; - }); - }, 400); - return () => clearInterval(timer); - } else { - setProgress(100); - } - }, [isStreaming]); - - const hasArguments = Object.keys(parsedTool.arguments).length > 0; - - return ( - - -
-
-
- -
- -
-
-
- - {displayName} - -

- MCP Server • {serverName} -

-
-
- - {!isStreaming && ( - - {isSuccess && result && !result.isError ? ( - - ) : ( - - )} - {isSuccess && result && !result.isError ? 'Completed successfully' : 'Execution failed'} - - )} -
-
- - - {isStreaming ? ( -
-
-
-
- -
- -
-
-

- Executing MCP Tool -

-

- {displayName} -

-

- via {serverName} server -

- -

{progress}%

-
-
- ) : ( - -
- - {/* Tool Information */} -
-
- -

Tool Details

-
-
-
- Server: - - {serverName} - -
-
- Tool: - - {toolName} - -
-
- Arguments: - - {argumentsCount} parameter{argumentsCount !== 1 ? 's' : ''} - -
-
- Status: - - {isSuccess && result && !result.isError ? 'Success' : 'Failed'} - -
-
- - {/* Show error type if available */} - {result?.error_type && ( -
-
- - - Error Type: {result.error_type} - -
-
- )} -
- {/* Result Section */} - {result && ( - -
setExpandedResult(!expandedResult)} - > -
-
- {result.success && !result.isError ? ( - <> - -

- Execution Result -

- - ) : ( - <> - -

- Error Result -

- - )} -
- {expandedResult ? ( - - ) : ( - - )} -
-
- - {expandedResult && ( -
- -
- )} -
- )} - - {/* Timestamps */} - {(assistantTimestamp || toolTimestamp) && ( -
-
- - - {toolTimestamp ? ( - `Completed ${formatTimestamp(toolTimestamp)}` - ) : assistantTimestamp ? ( - `Started ${formatTimestamp(assistantTimestamp)}` - ) : ( - '' - )} - -
-
- )} - - {/* MCP Info Footer */} -
- -
-

- Model Context Protocol (MCP) -

-

- This tool is provided by an external MCP server, enabling dynamic integration with specialized services and data sources. -

-
-
-
-
- )} - - - ); -} \ No newline at end of file diff --git a/frontend/src/components/thread/tool-views/mcp-tool/_utils.ts b/frontend/src/components/thread/tool-views/mcp-tool/_utils.ts deleted file mode 100644 index b8ad19d1..00000000 --- a/frontend/src/components/thread/tool-views/mcp-tool/_utils.ts +++ /dev/null @@ -1,354 +0,0 @@ -import { Search, Code, FileText, Network, Database, Server } from 'lucide-react'; - -export interface MCPResult { - success: boolean; - data: any; - isError?: boolean; - content?: string; - mcp_metadata?: { - server_name: string; - tool_name: string; - full_tool_name: string; - arguments_count: number; - is_mcp_tool: boolean; - }; - error_type?: string; - raw_result?: any; -} - -export interface ParsedMCPTool { - serverName: string; - toolName: string; - fullToolName: string; - displayName: string; - arguments: Record; -} - -/** - * Enhanced MCP tool name formatter that handles various naming conventions - */ -export function formatMCPToolDisplayName(serverName: string, toolName: string): string { - // Handle server name formatting - const formattedServerName = formatServerName(serverName); - - // Handle tool name formatting - const formattedToolName = formatToolName(toolName); - - return `${formattedServerName}: ${formattedToolName}`; -} - -/** - * Format server names with special handling for known services - */ -function formatServerName(serverName: string): string { - const serverMappings: Record = { - 'exa': 'Exa Search', - 'github': 'GitHub', - 'notion': 'Notion', - 'slack': 'Slack', - 'filesystem': 'File System', - 'memory': 'Memory', - 'anthropic': 'Anthropic', - 'openai': 'OpenAI', - 'composio': 'Composio', - 'langchain': 'LangChain', - 'llamaindex': 'LlamaIndex' - }; - - const lowerName = serverName.toLowerCase(); - return serverMappings[lowerName] || capitalizeWords(serverName); -} - -function formatToolName(toolName: string): string { - if (toolName.includes('-')) { - return toolName - .split('-') - .map(word => capitalizeWord(word)) - .join(' '); - } - if (toolName.includes('_')) { - return toolName - .split('_') - .map(word => capitalizeWord(word)) - .join(' '); - } - if (/[a-z][A-Z]/.test(toolName)) { - return toolName - .replace(/([a-z])([A-Z])/g, '$1 $2') - .split(' ') - .map(word => capitalizeWord(word)) - .join(' '); - } - return capitalizeWord(toolName); -} - -function capitalizeWord(word: string): string { - if (!word) return ''; - const upperCaseWords = new Set([ - 'api', 'url', 'http', 'https', 'json', 'xml', 'csv', 'pdf', 'id', 'uuid', - 'oauth', 'jwt', 'sql', 'html', 'css', 'js', 'ts', 'ai', 'ml', 'ui', 'ux' - ]); - const lowerWord = word.toLowerCase(); - if (upperCaseWords.has(lowerWord)) { - return word.toUpperCase(); - } - return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); -} - -function capitalizeWords(text: string): string { - return text - .split(/[\s_-]+/) - .map(word => capitalizeWord(word)) - .join(' '); -} - -function extractFromNewFormat(toolContent: string | object): MCPResult | null { - try { - let parsed: any; - - if (typeof toolContent === 'string') { - parsed = JSON.parse(toolContent); - } else { - parsed = toolContent; - } - - if (parsed && typeof parsed === 'object' && 'tool_execution' in parsed) { - const toolExecution = parsed.tool_execution; - - if (toolExecution && typeof toolExecution === 'object' && 'result' in toolExecution) { - const result = toolExecution.result; - const success = result.success === true; - let output = result.output; - - if (typeof output === 'string') { - try { - output = JSON.parse(output); - } catch (e) { - } - } - - const args = toolExecution.arguments || {}; - const toolName = args.tool_name || 'unknown_mcp_tool'; - const toolArgs = args.arguments || {}; - - const parts = toolName.split('_'); - const serverName = parts.length > 1 ? parts[1] : 'unknown'; - const actualToolName = parts.length > 2 ? parts.slice(2).join('_') : toolName; - - return { - success, - data: output, - isError: !success, - content: output, - mcp_metadata: { - server_name: serverName, - tool_name: actualToolName, - full_tool_name: toolName, - arguments_count: Object.keys(toolArgs).length, - is_mcp_tool: true - } - }; - } - } - - return null; - } catch (e) { - return null; - } -} - -function extractFromLegacyFormat(toolContent: string): MCPResult | null { - try { - const toolResultMatch = toolContent.match(/ToolResult\(success=(\w+),\s*output='([\s\S]*)'\)/); - if (toolResultMatch) { - const isSuccess = toolResultMatch[1] === 'True'; - let output = toolResultMatch[2]; - - output = output.replace(/\\n/g, '\n').replace(/\\'/g, "'").replace(/\\"/g, '"'); - - return { - success: isSuccess, - data: output, - isError: !isSuccess, - content: output - }; - } - - const xmlMatch = toolContent.match(/\s*\s*([\s\S]*?)\s*<\/call-mcp-tool>\s*<\/tool_result>/); - if (xmlMatch && xmlMatch[1]) { - const innerContent = xmlMatch[1].trim(); - - try { - const parsed = JSON.parse(innerContent); - - if (parsed.mcp_metadata) { - let actualContent = parsed.content; - if (typeof actualContent === 'string') { - try { - actualContent = JSON.parse(actualContent); - } catch (e) { - } - } - - return { - success: !parsed.isError, - data: actualContent, - isError: parsed.isError, - content: actualContent, - mcp_metadata: parsed.mcp_metadata, - error_type: parsed.error_type, - raw_result: parsed.raw_result - }; - } - - return { - success: !parsed.isError, - data: parsed.content || parsed, - isError: parsed.isError, - content: parsed.content - }; - } catch (e) { - return { - success: true, - data: innerContent, - content: innerContent - }; - } - } - - const parsed = JSON.parse(toolContent); - - if (parsed.mcp_metadata) { - let actualContent = parsed.content; - if (typeof actualContent === 'string') { - try { - actualContent = JSON.parse(actualContent); - } catch (e) { - } - } - - return { - success: !parsed.isError, - data: actualContent, - isError: parsed.isError, - content: actualContent, - mcp_metadata: parsed.mcp_metadata, - error_type: parsed.error_type, - raw_result: parsed.raw_result - }; - } - - return { - success: !parsed.isError, - data: parsed.content || parsed, - isError: parsed.isError, - content: parsed.content - }; - } catch (e) { - return null; - } -} - -export function parseMCPResult(toolContent: string | object | undefined): MCPResult { - if (!toolContent) { - return { - success: true, - data: '', - content: '' - }; - } - - const newFormatResult = extractFromNewFormat(toolContent); - if (newFormatResult) { - return newFormatResult; - } - - if (typeof toolContent === 'string') { - const legacyResult = extractFromLegacyFormat(toolContent); - if (legacyResult) { - return legacyResult; - } - } - - const content = typeof toolContent === 'string' ? toolContent : JSON.stringify(toolContent); - return { - success: true, - data: content, - content: content - }; -} - -export function parseMCPToolCall(assistantContent: string): ParsedMCPTool { - try { - const toolNameMatch = assistantContent.match(/tool_name="([^"]+)"/); - const fullToolName = toolNameMatch ? toolNameMatch[1] : 'unknown_mcp_tool'; - - const contentMatch = assistantContent.match(/]*>([\s\S]*?)<\/call-mcp-tool>/); - let args = {}; - - if (contentMatch && contentMatch[1]) { - try { - args = JSON.parse(contentMatch[1].trim()); - } catch (e) { - args = { raw: contentMatch[1].trim() }; - } - } - - const parts = fullToolName.split('_'); - const serverName = parts.length > 1 ? parts[1] : 'unknown'; - const toolName = parts.length > 2 ? parts.slice(2).join('_') : fullToolName; - - // Use the enhanced formatting function - const displayName = formatMCPToolDisplayName(serverName, toolName); - - return { - serverName, - toolName, - fullToolName, - displayName, - arguments: args - }; - } catch (e) { - return { - serverName: 'unknown', - toolName: 'unknown', - fullToolName: 'unknown_mcp_tool', - displayName: 'MCP Tool', - arguments: {} - }; - } -} - -export function getMCPServerIcon(serverName: string) { - switch (serverName.toLowerCase()) { - case 'exa': - return Search; - case 'github': - return Code; - case 'notion': - return FileText; - case 'slack': - return Network; - case 'filesystem': - return Database; - default: - return Server; - } -} - -export function getMCPServerColor(serverName: string) { - switch (serverName.toLowerCase()) { - case 'exa': - return 'from-blue-500/20 to-blue-600/10 border-blue-500/20'; - case 'github': - return 'from-purple-500/20 to-purple-600/10 border-purple-500/20'; - case 'notion': - return 'from-gray-500/20 to-gray-600/10 border-gray-500/20'; - case 'slack': - return 'from-green-500/20 to-green-600/10 border-green-500/20'; - case 'filesystem': - return 'from-orange-500/20 to-orange-600/10 border-orange-500/20'; - default: - return 'from-indigo-500/20 to-indigo-600/10 border-indigo-500/20'; - } -} \ No newline at end of file diff --git a/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx b/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx index db0ff437..16122a1f 100644 --- a/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx +++ b/frontend/src/components/thread/tool-views/wrapper/ToolViewRegistry.tsx @@ -81,8 +81,6 @@ const defaultRegistry: ToolViewRegistryType = { 'see-image': SeeImageToolView, - 'call-mcp-tool': GenericToolView, - 'ask': AskToolView, 'complete': CompleteToolView, diff --git a/frontend/src/components/thread/utils.ts b/frontend/src/components/thread/utils.ts index 57f03d69..546ccefb 100644 --- a/frontend/src/components/thread/utils.ts +++ b/frontend/src/components/thread/utils.ts @@ -153,11 +153,6 @@ export const getToolIcon = (toolName: string): ElementType => { case 'complete': return CheckCircle2; - // MCP tools - case 'call-mcp-tool': - return PlugIcon; - - // Default case default: if (toolName?.startsWith('mcp_')) { const parts = toolName.split('_'); @@ -335,7 +330,6 @@ const TOOL_DISPLAY_NAMES = new Map([ ['web-search', 'Searching Web'], ['see-image', 'Viewing Image'], - ['call-mcp-tool', 'External Tool'], ['update-agent', 'Updating Agent'], ['get-current-agent-config', 'Getting Agent Config'], diff --git a/frontend/src/lib/versioning/services/version-service.ts b/frontend/src/lib/versioning/services/version-service.ts index bfa8fc35..33733c26 100644 --- a/frontend/src/lib/versioning/services/version-service.ts +++ b/frontend/src/lib/versioning/services/version-service.ts @@ -33,10 +33,6 @@ export class VersionService implements IVersionService { agentId: string, request: CreateVersionRequest ): Promise { - if (!request.system_prompt?.trim()) { - throw new Error('System prompt cannot be empty'); - } - const newVersion = await this.repository.createVersion(agentId, request); console.log(`Created version ${newVersion.versionName} for agent ${agentId}`); return newVersion;