Skip to content

Conversation

aRaikoFunakami
Copy link

Fix mobile_take_screenshot MCP client compatibility

Problem

mobile_take_screenshot was returning empty responses to MCP clients, making it unusable.

Root Cause

The tool was using server.tool() directly instead of the tool() helper function used by all other tools.

Solution

  • Changed from server.tool() to tool() helper
  • Return Data URL string instead of complex object
  • Use ActionableError for consistent error handling

Result

  • Screenshot function now works properly with MCP clients
  • Consistent with all other tools in the codebase

…e format

- Change from server.tool() to tool() helper function for better MCP client compatibility
- Simplify return format from complex object to Data URL string format
- Improve error handling with ActionableError for consistency

Fixes mobile_take_screenshot function returning empty responses to MCP clients.
@gmegidish
Copy link
Member

@aRaikoFunakami thanks for the PR. which agents caused problems with this? we're testing this thoroughly on gemini, claude code and codex. But certainly another agent causes issues, I'd like to add it to our test suite. 🙏

@gmegidish
Copy link
Member

@aRaikoFunakami yo. I'm trying to reproduce the issue. where did you see that the current code fails? under which model and agent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants