Skip to content

Commit f91dd6f

Browse files
Revert "Merge pull request #27 from nandatheguntupalli/error"
This reverts commit f6fa4ad, reversing changes made to c057809.
1 parent f6fa4ad commit f91dd6f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

webEvalAgent/mcp_server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# MCP imports
1717
from mcp.server.fastmcp import FastMCP, Context
18-
from mcp.types import TextContent, ImageContent
18+
from mcp.types import TextContent
1919
# Removing the problematic import
2020
# from mcp.server.tool import Tool, register_tool
2121

@@ -54,7 +54,7 @@ class BrowserTools(str, Enum):
5454
print("Error: No API key provided. Please set the OPERATIVE_API_KEY environment variable.")
5555

5656
@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]:
5858
"""Evaluate the user experience / interface of a web application.
5959
6060
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
8484
error_message_str = "❌ Error: API Key validation failed when running the tool.\n"
8585
error_message_str += " Reason: Free tier limit reached.\n"
8686
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)]
8888
try:
8989
# Generate a new tool_call_id for this specific tool call
9090
tool_call_id = str(uuid.uuid4())
@@ -95,10 +95,10 @@ async def web_eval_agent(url: str, task: str, ctx: Context, headless_browser: bo
9595
)
9696
except Exception as e:
9797
tb = traceback.format_exc()
98-
return [[TextContent(
98+
return [TextContent(
9999
type="text",
100100
text=f"Error executing web_eval_agent: {str(e)}\n\nTraceback:\n{tb}"
101-
)]]
101+
)]
102102

103103
@mcp.tool(name=BrowserTools.SETUP_BROWSER_STATE)
104104
async def setup_browser_state(url: str = None, ctx: Context = None) -> list[TextContent]:

webEvalAgent/src/tool_handlers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_browser_manager() -> PlaywrightBrowserManager:
4040
"""
4141
return PlaywrightBrowserManager.get_instance()
4242

43-
async def handle_web_evaluation(arguments: Dict[str, Any], ctx: Context, api_key: str) -> list[list[TextContent | ImageContent]]:
43+
async def handle_web_evaluation(arguments: Dict[str, Any], ctx: Context, api_key: str) -> list[TextContent]:
4444
"""Handle web_eval_agent tool calls
4545
4646
This function evaluates the user experience of a web application by using
@@ -86,16 +86,16 @@ async def handle_web_evaluation(arguments: Dict[str, Any], ctx: Context, api_key
8686
send_log(f"Added https:// protocol to URL: {url}", "🔗")
8787

8888
if not url or not isinstance(url, str):
89-
return [[TextContent(
89+
return [TextContent(
9090
type="text",
9191
text="Error: 'url' must be a non-empty string containing the web application URL to evaluate."
92-
)]]
92+
)]
9393

9494
if not task or not isinstance(task, str):
95-
return [[TextContent(
95+
return [TextContent(
9696
type="text",
9797
text="Error: 'task' must be a non-empty string describing the UX/UI aspect to test."
98-
)]]
98+
)]
9999

100100
# Send initial status to dashboard
101101
send_log(f"🚀 Received web evaluation task: {task}", "🚀")

0 commit comments

Comments
 (0)