Skip to main content
Glama
WhiteNightShadow

camoufox-reverse-mcp

compare_env

Collect browser environment fingerprint data to compare with Node.js/jsdom. Specify properties to check or use defaults: navigator, screen, canvas, WebGL, audio, timing.

Instructions

Collect browser environment fingerprint data for comparison with Node.js/jsdom.

Args: properties: Optional list of specific properties to check. If omitted, checks navigator, screen, canvas, WebGL, audio, timing.

Returns: dict with categorized environment data and their values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
propertiesNo

Implementation Reference

  • The compare_env tool handler — an MCP tool that collects browser environment fingerprint data (navigator, screen, canvas, WebGL, audio, timing) for comparison with Node.js/jsdom. Decorated with @mcp.tool() to register as an MCP tool.
    @mcp.tool()
    async def compare_env(properties: list[str] | None = None) -> dict:
        """Collect browser environment fingerprint data for comparison with Node.js/jsdom.
    
        Args:
            properties: Optional list of specific properties to check.
                If omitted, checks navigator, screen, canvas, WebGL, audio, timing.
    
        Returns:
            dict with categorized environment data and their values.
        """
        try:
            page = await browser_manager.get_active_page()
            custom_props_js = ""
            if properties:
                custom_props_js = f"""
                const customProps = {json.dumps(properties)};
                for (const prop of customProps) {{
                    try {{
                        const val = eval(prop);
                        result.custom[prop] = {{
                            value: typeof val === 'object' ? JSON.stringify(val).substring(0, 500) : String(val),
                            type: typeof val
                        }};
                    }} catch(e) {{
                        result.custom[prop] = {{ value: null, error: e.message }};
                    }}
                }}"""
    
            result = await page.evaluate(f"""() => {{
                const result = {{ navigator: {{}}, screen: {{}}, canvas: {{}}, webgl: {{}},
                                 audio: {{}}, timing: {{}}, misc: {{}}, custom: {{}} }};
                const navProps = ['userAgent', 'platform', 'language', 'languages',
                    'hardwareConcurrency', 'deviceMemory', 'maxTouchPoints',
                    'vendor', 'cookieEnabled', 'webdriver'];
                for (const p of navProps) {{
                    try {{ result.navigator[p] = {{ value: String(navigator[p]), type: typeof navigator[p] }}; }}
                    catch(e) {{ result.navigator[p] = {{ value: null, error: e.message }}; }}
                }}
                const screenProps = ['width', 'height', 'availWidth', 'availHeight', 'colorDepth'];
                for (const p of screenProps) {{
                    try {{ result.screen[p] = {{ value: screen[p], type: typeof screen[p] }}; }}
                    catch(e) {{ result.screen[p] = {{ value: null, error: e.message }}; }}
                }}
                result.screen.devicePixelRatio = {{ value: window.devicePixelRatio, type: 'number' }};
                result.timing.timezoneOffset = {{ value: new Date().getTimezoneOffset(), type: 'number' }};
                result.timing.timezone = {{ value: Intl.DateTimeFormat().resolvedOptions().timeZone, type: 'string' }};
                {custom_props_js}
                return result;
            }}""")
            return result
        except Exception as e:
            return {"error": str(e)}
  • Registration import in server.py — imports the jsvmp module (which contains compare_env) so the @mcp.tool() decorator registers it on the FastMCP server.
    from .tools import jsvmp            # noqa: E402, F401  — hook_jsvmp_interpreter + compare_env
  • Fallback helper in trace.py — _fallback_compare_env() calls compare_env when engine-level tracing is not available (i.e., using official Camoufox without enable_trace).
    async def _fallback_compare_env(reason: str) -> dict:
        """Fallback to compare_env when custom browser is not available."""
        try:
            from .jsvmp import compare_env
            result = await compare_env()
        except Exception as e:
            result = {"error": f"compare_env also failed: {e}"}
    
        return {
            "mode": "fallback_compare_env",
            "reason": reason,
            "install_hint": (
                "To use engine-level tracing:\n"
                "1. Download camoufox-reverse from GitHub Releases\n"
  • The function signature itself serves as the schema — parameters are `properties: list[str] | None = None` (optional list of property names to check) and return type is `dict`.
    async def compare_env(properties: list[str] | None = None) -> dict:
        """Collect browser environment fingerprint data for comparison with Node.js/jsdom.
    
        Args:
            properties: Optional list of specific properties to check.
                If omitted, checks navigator, screen, canvas, WebGL, audio, timing.
    
        Returns:
            dict with categorized environment data and their values.
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that the tool collects fingerprint data and returns categorized environment data, but does not mention side effects, performance impact, or permissions. The description covers basic behavior but lacks depth.

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 concise, front-loaded with the main purpose, and includes structured argument and return information. Every sentence adds value with no redundancy.

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

Completeness4/5

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

Given no output schema, the description provides return format and category examples. It is mostly complete for a simple tool with one optional parameter, though it could mention if there are any side effects or prerequisites.

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?

With 0% schema coverage, the description compensates by explaining the 'properties' parameter's purpose and default behavior (if omitted, checks common categories). This adds significant value beyond the schema type definition.

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 collects browser environment fingerprint data for comparison with Node.js/jsdom, using specific verbs and resource. However, it does not explicitly differentiate from the sibling tool 'check_environment', which may have overlapping functionality.

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

Usage Guidelines3/5

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

The description implies usage for comparing browser vs Node.js/jsdom environments but lacks explicit guidance on when to use this tool versus alternatives. No exclusions or when-not-to-use information is provided.

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