Skip to main content
Glama
WhiteNightShadow

camoufox-reverse-mcp

take_snapshot

Capture the accessibility tree of the current page for token-efficient analysis in dynamic debugging.

Instructions

Get the accessibility tree of the current page (token-efficient).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The take_snapshot handler function. Uses @mcp.tool() decorator. First tries Playwright's accessibility.snapshot(), falls back to a JS walk() of the DOM to build an accessibility tree (role, name, value, text, children). Returns {'snapshot': ...} or {'error': ...}.
    @mcp.tool()
    async def take_snapshot() -> dict:
        """Get the accessibility tree of the current page (token-efficient)."""
        try:
            page = await browser_manager.get_active_page()
            try:
                snapshot = await page.accessibility.snapshot()
            except AttributeError:
                snapshot = await page.evaluate("""() => {
                    function walk(node) {
                        if (!node) return null;
                        const item = {};
                        const tag = node.tagName ? node.tagName.toLowerCase() : '';
                        const role = node.getAttribute ? (node.getAttribute('role') || tag) : '';
                        if (role) item.role = role;
                        const name = node.getAttribute ? (node.getAttribute('aria-label')
                            || node.getAttribute('alt') || node.getAttribute('title')
                            || (node.tagName === 'INPUT' ? node.getAttribute('placeholder') : '')
                            || '') : '';
                        if (name) item.name = name;
                        if (['INPUT','TEXTAREA','SELECT'].includes(node.tagName)) item.value = node.value || '';
                        const text = [], children = [];
                        for (const child of (node.childNodes || [])) {
                            if (child.nodeType === 3) { const t = child.textContent.trim(); if (t) text.push(t); }
                            else if (child.nodeType === 1) { const c = walk(child); if (c) children.push(c); }
                        }
                        if (text.length && !children.length) item.text = text.join(' ');
                        if (children.length) item.children = children;
                        if (!item.role && !item.name && !item.text && !children.length) return null;
                        return item;
                    }
                    return walk(document.body);
                }""")
            return {"snapshot": snapshot}
        except Exception as e:
            return {"error": str(e)}
  • FastMCP instance ('camoufox-reverse-mcp') created here. The @mcp.tool() decorator on take_snapshot registers it with this server.
    mcp = FastMCP(
        "camoufox-reverse-mcp",
        instructions="Anti-detection browser MCP server for JavaScript reverse engineering. "
        "Uses Camoufox (C++ engine-level fingerprint spoofing) to bypass bot detection "
        "while performing JS analysis, debugging, hooking, network interception, "
        "and JSVMP bytecode analysis."
    )
  • The navigation module (containing take_snapshot) is imported and registered as part of the server's tool set.
    from .tools import navigation      # noqa: E402, F401  — browser control + page interaction
Behavior2/5

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

No annotations provided; description mentions 'token-efficient' but does not disclose whether the tool is read-only, has side effects, or what the output contains. Significant gaps remain.

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

Conciseness4/5

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

Single sentence, front-loaded with the core purpose. The 'token-efficient' note adds value but is extra; still, no wasted words.

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

Completeness2/5

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

Despite zero parameters, the description fails to explain what the accessibility tree contains or how to interpret the result, and no output schema compensates. Incomplete for safe agent use.

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?

No parameters exist, so the description adds no parameter information, which is acceptable. Schema coverage is trivially 100%.

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 clearly states the tool retrieves the accessibility tree, which is a specific resource. However, it does not differentiate from siblings like 'take_screenshot' nor explain the scope.

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?

No guidance on when to use this tool versus alternatives such as 'take_screenshot' or 'get_page_info'. The usage context is implied but not explicit.

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/WhiteNightShadow/camoufox-reverse-mcp'

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