ScreenshotNeo

BlogAI agents

How to troubleshoot an MCP screenshot tool that times out on large webpages

Find which timeout is failing, reduce oversized captures, and choose a reliable retry path for large webpages.

By the ScreenshotNeo team4 October 20269 min read

A timeout on a large webpage can happen during navigation, screenshot capture, a remote service operation, or delivery of the resulting image to the MCP client. Identify which stage failed first. Then try a smaller capture scope or lower-output format before changing timeouts.

For a page where the entire visual layout matters, full-page capture may still be necessary. If you need only text and structure, use an accessibility snapshot instead. MCP does not define one universal screenshot timeout or response-size limit: check the documentation and configuration for the server and client you actually use.

1. Identify which part timed out

Record the MCP tool name, exact error code and message, whether navigation completed, and whether the server returned an error or the client simply stopped waiting. A tall page alone does not prove that page height caused the failure.

Stage What may be happening What to inspect
Navigation The browser has not finished loading or reached the expected navigation condition. Navigation timeout, page load state, redirects, and network or application errors.
Action or capture The screenshot action, selector wait, or post-action settle step exceeded its own deadline. Action timeout, target selector, screenshot scope, and server logs if available.
Service operation A hosted browser service ended the command after its service deadline. Service error code and the provider’s current command-timeout documentation.
Response delivery The browser finished, but the result was too large or the MCP client stopped waiting for the response. Output-size errors, client call deadline, transport limits, and whether the tool returns image data inline.

These deadlines are separate. Increasing a navigation timeout does not necessarily increase the screenshot action deadline, a hosted service deadline, or the client’s response deadline.

As implementation-specific examples, the Microsoft Playwright MCP repository documents defaults of 5,000 ms for actions, 60,000 ms for navigation, and a 500 ms settle interval after actions. These are Playwright MCP settings, not MCP protocol defaults; versions and configuration may differ. Microsoft’s documentation for its hosted Playwright Workspaces remote MCP service describes a 3 minute 30 second command timeout. Check the current documentation and running configuration for your own versions and deployment.

2. Reduce the amount the tool must capture and return

If the failure occurs on a full-page screenshot, make one diagnostic call with a smaller target:

  1. Capture the current viewport instead of the full document.
  2. If the relevant content is in a known region, capture that element by selector.
  3. Use CSS-pixel scale when device-pixel detail is unnecessary.
  4. Use JPEG if the server supports it and lossy compression is acceptable. Keep PNG when lossless detail matters. Check the server’s supported formats; Playwright MCP documents PNG, JPEG, and WebP, while Microsoft’s hosted remote service documents PNG and JPEG.

Smaller images can reduce capture work, response size, and delivery time. A viewport or element capture is not a substitute when the visual evidence you need is elsewhere on the page. In Playwright MCP’s documented screenshot interface, full-page and element capture cannot be combined.

Choice Use it when Tradeoff
Viewport You are diagnosing the visible screen or initial rendering. Content outside the viewport is omitted.
Element You know which chart, section, or component matters. Other page content and its wider context are omitted.
Full page You need visual evidence across the entire document. May take longer and produce a larger image response.
JPEG Smaller output matters and some compression is acceptable. Lossy compression may blur fine text or visual details.
PNG You need lossless detail, such as crisp text or visual comparison. Can create a larger response than a compressed JPEG.
CSS scale CSS-pixel output is sufficient. Lower resolution than device-pixel capture on high-DPI displays.
Device scale You need higher-resolution output tied to device pixel ratio. More pixels can mean more capture work and response data.

Playwright documents the distinction between CSS-pixel and device-pixel scale, and its MCP screenshot interface documents viewport, target-element, and full-page capture choices. Consult the [Playwright MCP screenshot documentation](https://playwright.dev/mcp/tools/screenshots) for the options supported by your installed version.

3. Check whether the image was captured but could not be returned

A capture can complete successfully while inline image delivery fails. Microsoft’s hosted Playwright Workspaces remote MCP documentation distinguishes OutputTooLarge from ToolTimeout and lists a 768 KiB inline screenshot base64 limit for that service. Neither the limit nor its error names apply universally to MCP tools.

If the error indicates an oversized result, try JPEG, a viewport, or an element capture. If the server supports saving to a file rather than returning image data inline, that may avoid an inline-response limit. The Playwright MCP screenshot tool documents a filename option and a server option to omit image responses. Before relying on a saved artifact, confirm that your MCP client or environment can access the file.

4. Use a page snapshot when you need text or structure

If the task is to find headings, links, labels, or accessible structure, request an accessibility snapshot instead of a screenshot. A snapshot represents page content and structure without encoding the entire visual surface as image data. Playwright describes snapshots as a better choice for page understanding and its screenshots guidance recommends them for structure and text.

Use a screenshot when the question is visual: layout, a chart or canvas, a rendering defect, or what the page looks like. Snapshots can also be large. Microsoft’s remote service documentation describes snapshot truncation and recommends reducing depth or targeting a smaller area when snapshot text is too large.

5. Inspect the browser state before retrying

  1. Determine whether the MCP session and browser are still available.
  2. Inspect the current page or browser state if the tool allows it. Navigation may have succeeded even if a later capture or response step timed out.
  3. Choose a smaller or more targeted read-only capture and make a bounded retry.
  4. If the page is still loading, adjust the relevant navigation or action setting in the server configuration, then check whether the MCP client deadline is long enough to receive the result.

Microsoft advises observing the page before deciding whether to retry when its hosted service session remains available. Do not blindly repeat timed-out actions such as clicks: a click may have taken effect even when its response was lost. A screenshot is usually read-only, but still inspect the session so you do not spend time repeating an operation that already completed.

6. Example: make a smaller capture with Playwright MCP

Playwright MCP exposes its screenshot options through MCP tool calls rather than a universal command-line syntax. The following examples show the relevant choices using the tool interface documented by the project. Match the exact parameter names and tool schema to the version configured in your MCP client.

Viewport screenshot

{"name":"browser_take_screenshot","arguments":{"type":"png","fullPage":false,"scale":"css"}}

Full-page screenshot

{"name":"browser_take_screenshot","arguments":{"type":"jpeg","fullPage":true,"scale":"css"}}

Target an element

{"name":"browser_take_screenshot","arguments":{"type":"jpeg","element":"main article","scale":"css"}}

These are illustrative MCP tool-call payloads, not standalone JSON-RPC requests; clients may wrap tool calls differently. The project’s interface documents a viewport, an element target, or full-page capture, and says not to combine full-page and element capture. If the exact schema differs in your setup, inspect the server’s exposed tool definition. For the primary configuration and screenshot guidance, see the [Microsoft Playwright MCP repository](https://github.com/microsoft/playwright-mcp) and [Playwright screenshot documentation](https://playwright.dev/mcp/tools/screenshots).

7. Troubleshooting common errors

Symptom or error Likely cause Next step
Navigation timeout The page did not reach the configured navigation condition before the navigation deadline. Confirm whether it loaded partially, then review the navigation timeout and wait condition. Check whether the client deadline allows that wait.
Action timeout during screenshot The capture or another action exceeded its action deadline, or the target is not ready. Check the action timeout and selector; try a viewport or smaller target to isolate capture size and page behavior.
ToolTimeout from a hosted browser service The remote command exceeded that service’s operation deadline. Inspect browser state if the session remains available, then retry with a smaller capture if appropriate. Check the service’s current deadline.
OutputTooLarge or truncated inline image The capture may have succeeded, but the inline response exceeded a service or client limit. Try JPEG, viewport or element scope, or a saved artifact if the server and client both support file access.
Client reports timeout but server reports success The MCP client stopped waiting before the server finished delivering the response. Check client call deadline, transport behavior, and output size separately from browser timeouts.
Blank or partial screenshot The page may still be loading, content may render after the selected wait condition, or lazy content may require scrolling. Inspect the page state, wait for the relevant selector or content using supported server options, then capture only the needed region. Avoid an unbounded wait.
Element capture fails The selector may not match, may be hidden, or may not be supported in the configured tool version. Confirm the selector exists in the current page and use a viewport capture as a diagnostic fallback.
Repeated retries do not help The retry repeats the same oversized capture or changes a timeout unrelated to the failing stage. Capture the exact error and stage, inspect browser state, and change one relevant variable at a time.

8. Performance, reliability, and cost considerations

  • Image size: Full-page and device-scale captures can contain many more pixels than a viewport at CSS scale. Use the smallest scope and resolution that answer the question.
  • Response path: Inline images consume response bandwidth and may encounter client or service limits. A saved artifact can help only when the client can retrieve it.
  • Deadlines: Set related navigation, action, service, and client deadlines intentionally. A generous browser timeout cannot fix a shorter client response deadline.
  • Retries: Bound retries and inspect state first. Repeated calls can waste browser resources and may duplicate state-changing actions if the timed-out tool was not read-only.
  • Cost: Hosted browser services may have their own pricing and usage rules; consult the provider’s current terms. Reducing capture work can reduce wasted operations, but do not assume it changes billing without checking the service’s policy.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. Its API returns a screenshot or PDF from one GET request, and its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are never billed.

For a direct API call, see the ScreenshotNeo API documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo offers 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000. Sign up for free and get 1,000 screenshots a month with no card.

FAQ

Is a full-page screenshot timeout always caused by a page being too long?

No. The failure may be navigation, an action or capture deadline, a hosted service deadline, or image response delivery. Use the error and session state to identify the stage.

Does MCP set a standard screenshot timeout?

The cited timeouts are settings of particular servers and services. Check the documentation for the MCP server and client you run; do not treat one implementation’s defaults as protocol-wide.

Should I always use JPEG for a large screenshot?

No. JPEG can reduce response size, but it is lossy. Use it when compression is acceptable; use a supported lossless format when fine detail matters.

What if I need the whole page but cannot return it inline?

Check whether the screenshot server can save the image to a location your client can access. If it cannot, you may need a server or client with a suitable delivery path, or a different way to split the visual task into smaller captures.