Skip to main content
Glama
camoufox-reverse-mcp

camoufox-reverse-mcp

hook_jsvmp_interpreter

Install a JSVMP runtime probe in the page main world before navigation to record script property reads and calls for reverse-engineering JSVMP obfuscation and anti-bot logic.

Instructions

Install a JSVMP runtime probe in the page main world.

The probe runs where page scripts run, so their property reads and calls are recorded. Read the log with evaluate_js("window.__mcp_jsvmp_log || []", world="main"); the default isolated world cannot see it. remove_hooks() restores what the probe replaced. Each event has a seq; window.__mcp_jsvmp_meta.dropped counts events lost to max_entries. Same-origin frames (including about:blank iframes created and removed by the page) log into the top frame's log with frame_url/frame_depth. The result's coverage lists what this probe records and what it cannot see: a missing entry means "not observed", not "not called".

mode="proxy" wraps Function.prototype.apply/call/bind, Reflect.*, Date.now, performance.now and Math.random, and puts Proxies on globals (navigator, screen, etc.). Page code can detect all of this, so RS/AK-style signature-based anti-bot will notice; use instrumentation(action='install') (source-level rewrite) for those. mode="transparent" only replaces getters on prototypes (Navigator, Screen, Document, ...). It changes less, but the getters are no longer the originals: Function.prototype.toString.call(getter) shows JS source.

IMPORTANT — timing for sync-loaded SDKs (e.g. webmssdk): JSVMP interpreters capture native references at startup via closures. If you install hooks AFTER the SDK has loaded, the SDK's closures already hold the original (un-hooked) references — your hooks will never fire. You MUST install hooks BEFORE navigate(): 1. launch_browser() 2. hook_jsvmp_interpreter(mode='transparent', persistent=True) 3. navigate("https://www.douyin.com/...") If already navigated, call instrumentation(action='reload') after installing hooks to force a page reload with hooks active.

Args: script_url: Target script URL substring for stack filtering. persistent: Survive navigation (default True). mode: "proxy" (full coverage, detectable) or "transparent" (replaces getters only). track_calls, track_props, track_reflect: Only for mode="proxy". proxy_objects: Objects to proxy (default: navigator, screen, etc.). max_entries: Log buffer cap (default 10000).

Returns: dict with status, mode, world, read_with and install details.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "hook_jsvmp_interpreter"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoproxy
persistentNo
script_urlNo
max_entriesNo
track_callsNo
track_propsNo
proxy_objectsNo
track_reflectNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.1.1
    • removedInput schema / properties / proxy_objects / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / proxy_objects / default
      Removed value: -null
    • addedInput schema / properties / proxy_objects / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / proxy_objects / type
      Added value: +"array"
  2. Changed8 schema fields changedv1.0.0
    • addedInput schema / properties / max_entries
      Added value: +{
      +  "default": 10000,
      +  "title": "Max Entries",
      +  "type": "integer"
      +}
    • addedInput schema / properties / mode
      Added value: +{
      +  "default": "proxy",
      +  "title": "Mode",
      +  "type": "string"
      +}
    • addedInput schema / properties / proxy_objects
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Proxy Objects"
      +}
    • addedInput schema / properties / script_url / default
      Added value: +""
    • addedInput schema / properties / track_calls
      Added value: +{
      +  "default": true,
      +  "title": "Track Calls",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / track_props
      Added value: +{
      +  "default": true,
      +  "title": "Track Props",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / track_reflect
      Added value: +{
      +  "default": true,
      +  "title": "Track Reflect",
      +  "type": "boolean"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "script_url"
      -]
  3. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so: it names exactly what proxy mode wraps (Function.prototype.apply/call/bind, Reflect.*, Date.now, etc.), what transparent mode replaces, that getters cease to be native, that remove_hooks() restores state, that max_entries can drop events (window.__mcp_jsvmp_meta.dropped), and how cross-frame logging behaves.

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?

Purpose is front-loaded and the sections are clearly delineated, but the length is substantial and the IMPORTANT timing block is somewhat verbose and partially restates the intro's world/restore points. Given the tool's complexity the length is largely earned rather than padding.

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

Completeness5/5

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

For a complex, 8-parameter, no-annotation, no-output-schema tool, the definition covers everything an agent needs: setup ordering, how to read results back (evaluate_js with world="main"), coverage/dropped-event semantics, cleanup via remove_hooks(), and a Returns summary.

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 description coverage and 8 parameters, the Args block is doing real work — it explains mode values, that track_calls/track_props/track_reflect apply only to proxy mode, what proxy_objects defaults to, and what max_entries caps. It stops short of giving format/type detail for script_url (matching semantics) and defaults beyond what the schema already states.

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

Purpose5/5

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

Opens with a specific verb and resource: "Install a JSVMP runtime probe in the page main world." It immediately clarifies scope (main world vs isolated world) and differentiates itself from instrumentation(action='install') and evaluate_js by explaining what each does differently.

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

Usage Guidelines5/5

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

Explicit when-to-use guidance for mode='proxy' vs mode='transparent', including the anti-bot detectability tradeoff and when to prefer instrumentation instead. It also gives a concrete ordered procedure (launch_browser → hook → navigate) and the fallback (instrumentation(action='reload')) when the page is already loaded.

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