Skip to main content
Glama

screenshot

Take a screenshot of the current page to record visual state for QA verification.

Instructions

Take a screenshot of the current page.

Args: name: Name for the screenshot file (without extension)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoscreenshot

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function for 'screenshot'. It requires an active session, captures the current step, calls _auto_screenshot, and returns the saved path.
    @mcp.tool()
    async def screenshot(name: str = "screenshot") -> str:
        """Take a screenshot of the current page.
    
        Args:
            name: Name for the screenshot file (without extension)
        """
        s = _require_session()
        last_step = s.steps[-1] if s.steps else "Initial state"
        path = await _auto_screenshot(s, name, last_step)
        return f"Screenshot saved: {path}"
  • Helper function _auto_screenshot that increments the counter, constructs a safe filename, calls the browser's screenshot method, and records the Screenshot in the session.
    async def _auto_screenshot(s: Session, name: str, step: str) -> str:
        """Take a screenshot and register it in the session."""
        s._screenshot_counter += 1
        safe_name = f"{s._screenshot_counter:03d}_{name}"
        path = str(Path(_output_dir()) / "screenshots" / f"{safe_name}.png")
        await s.browser.screenshot(path)
        url = s.browser._page.url if s.browser._page else ""
        s.screenshots.append(Screenshot(
            path=path, name=safe_name, step=step, url=url,
        ))
        return path
  • The BrowserDriver.screenshot method which uses Playwright to capture a full-page screenshot to disk, creating parent directories as needed.
    async def screenshot(self, path: str) -> str:
        Path(path).parent.mkdir(parents=True, exist_ok=True)
        await self._page.screenshot(path=path, full_page=False)
        return path
  • The Screenshot dataclass model that stores metadata about each captured screenshot (path, name, step, url, timestamp).
    class Screenshot:
        path: str
        name: str
        step: str
        url: str
        timestamp: datetime = field(default_factory=datetime.now)
  • The MCP server registration (FastMCP instance). The screenshot tool is registered via the @mcp.tool() decorator on line 427.
    mcp = FastMCP(
        "argus",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It states it takes a screenshot and implies file creation via the 'name' parameter, but lacks details such as file format, save location, impact on the page (none), or any destructive effects. This is insufficient for an agent to fully understand side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: one sentence plus a parameter note. Every part is necessary, and there is no redundant or verbose language. It is efficiently front-loaded with the primary action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema (not shown) which may describe return values, so the description does not need to. However, it misses details like whether the screenshot captures the full page or viewport and what format is used. Given low complexity, it is minimally adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite schema description coverage of 0%, the description adds meaningful context to the 'name' parameter: 'Name for the screenshot file (without extension).' This goes beyond the schema's title and default by clarifying that no extension is needed, which is helpful for correct tool invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Take a screenshot of the current page,' which clearly identifies the verb and resource. It distinguishes from sibling tools because no other tool directly captures an image of the page. However, it does not specify whether it captures the visible viewport or full page, slightly reducing clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives (e.g., when to use get_page_state for text content). There are no explicit conditions, prerequisites, or comparisons to siblings, so the agent must infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chriswu727/argus'

If you have feedback or need assistance with the MCP directory API, please join our Discord server