15
15
16
16
# MCP imports
17
17
from mcp .server .fastmcp import FastMCP , Context
18
- from mcp .types import TextContent , ImageContent
18
+ from mcp .types import TextContent
19
19
# Removing the problematic import
20
20
# from mcp.server.tool import Tool, register_tool
21
21
@@ -54,7 +54,7 @@ class BrowserTools(str, Enum):
54
54
print ("Error: No API key provided. Please set the OPERATIVE_API_KEY environment variable." )
55
55
56
56
@mcp .tool (name = BrowserTools .WEB_EVAL_AGENT )
57
- async def web_eval_agent (url : str , task : str , ctx : Context , headless_browser : bool = False ) -> list [list [ TextContent | ImageContent ] ]:
57
+ async def web_eval_agent (url : str , task : str , ctx : Context , headless_browser : bool = False ) -> list [TextContent ]:
58
58
"""Evaluate the user experience / interface of a web application.
59
59
60
60
This tool allows the AI to assess the quality of user experience and interface design
@@ -84,7 +84,7 @@ async def web_eval_agent(url: str, task: str, ctx: Context, headless_browser: bo
84
84
error_message_str = "❌ Error: API Key validation failed when running the tool.\n "
85
85
error_message_str += " Reason: Free tier limit reached.\n "
86
86
error_message_str += " 👉 Please subscribe at https://operative.sh to continue."
87
- return [[ TextContent (type = "text" , text = error_message_str )] ]
87
+ return [TextContent (type = "text" , text = error_message_str )]
88
88
try :
89
89
# Generate a new tool_call_id for this specific tool call
90
90
tool_call_id = str (uuid .uuid4 ())
@@ -95,10 +95,10 @@ async def web_eval_agent(url: str, task: str, ctx: Context, headless_browser: bo
95
95
)
96
96
except Exception as e :
97
97
tb = traceback .format_exc ()
98
- return [[ TextContent (
98
+ return [TextContent (
99
99
type = "text" ,
100
100
text = f"Error executing web_eval_agent: { str (e )} \n \n Traceback:\n { tb } "
101
- )]]
101
+ )]
102
102
103
103
@mcp .tool (name = BrowserTools .SETUP_BROWSER_STATE )
104
104
async def setup_browser_state (url : str = None , ctx : Context = None ) -> list [TextContent ]:
0 commit comments