Skip to main content
Glama
WhiteNightShadow

camoufox-reverse-mcp

instrumentation

Instrument JavaScript code with JSVMP to trace and log runtime behavior, supporting install, log, stop, reload, and status actions for reverse engineering.

Instructions

JSVMP source-level instrumentation (v0.9.0 unified).

Replaces instrument_jsvmp_source / get_instrumentation_log / stop_instrumentation / reload_with_hooks.

Args: action: "install" — register route + AST/regex rewrite on matched scripts. Requires url_pattern. (was: instrument_jsvmp_source) "log" — fetch accumulated tap events from instrumented code. (was: get_instrumentation_log) "stop" — unregister instrumentation route. (was: stop_instrumentation) "reload" — reload page so persistent hooks fire before page JS. (was: reload_with_hooks) "status" — show active instrumentations and stats. (was: get_instrumentation_status) url_pattern: For "install"/"stop" — glob pattern matching VMP script URLs. mode: For "install" — "ast" (esprima then local bundled Acorn) or "regex" (conservative whole-program subset; unsupported input skipped). tag: For "install"/"log" — group identifier. rewrite_member_access: For "install" — tap obj[key] reads. rewrite_calls: For "install" — tap fn(args) calls. include_source_site: For "install" — attach a stable site_id and monotonic seq to tap events, plus an original-source range map in the log response. Default False. max_rewrites: For "install" — hard cap on rewrites per file. fallback_on_error: For "install" — try conservative regex on AST failure only without property/object filters; otherwise pass through unchanged. ignore_csp: For "install" — skip CSP pre-flight check. clear_log: For "reload" — clear JSVMP logs before reload. wait_until: For "reload" — "load" / "domcontentloaded" / "networkidle". tag_filter: For "log" — filter by tag. type_filter: For "log" — "tap_get", "tap_call", "tap_method", "tap_call_err". key_filter: For "log" — substring match on property/method name. limit: For "log" — max entries to return. clear: For "log" — clear log after retrieval in the selected main world. frame_url: For log; select a target frame by URL pattern. frame_name: For log; select a target frame by name. frame_index: For log; current frame snapshot index, not a persistent identity. Source scripts run in the main world; logs are always read there. filter_property_names: For AST "install" — only rewrite reads/methods of these property names (e.g. ['userAgent', 'platform', 'webdriver']). Dramatically reduces overhead for large files like webmssdk. filter_object_names: For AST "install" — only rewrite when the static base object path matches (e.g. ['navigator', 'this.bytecode']). Dynamic object identity is not inferred. Regex mode rejects nonempty filters. max_file_size: For "install" — files larger than this (bytes) trigger on_oversized behavior. Default 200KB. on_oversized: For "install" — "selective" (require filters), "skip", or "force" (full rewrite anyway). Default "selective".

Returns: dict with action-specific results.

IMPORTANT — timing for sync-loaded scripts (e.g. webmssdk): Route interception only catches requests made AFTER the route is registered. For scripts loaded via during page load, you MUST call instrumentation(action='install') BEFORE navigate(). Pattern: 1. launch_browser() 2. instrumentation(action='install', url_pattern='**/webmssdk*') 3. navigate("https://www.douyin.com/...") If called after navigate, use instrumentation(action='reload') to re-trigger page load with routes active.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagNovmp
modeNoast
clearNo
limitNo
actionYes
clear_logNo
frame_urlNo
frame_nameNo
ignore_cspNo
key_filterNo
tag_filterNo
wait_untilNoload
frame_indexNo
type_filterNo
url_patternNo
max_rewritesNo
on_oversizedNoselective
max_file_sizeNo
rewrite_callsNo
fallback_on_errorNo
filter_object_namesNo
include_source_siteNo
filter_property_namesNo
rewrite_member_accessNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.8.0
    • addedInput schema / properties / frame_index
      Added value: +{
      +  "title": "Frame Index",
      +  "type": "integer"
      +}
    • addedInput schema / properties / frame_name
      Added value: +{
      +  "title": "Frame Name",
      +  "type": "string"
      +}
    • addedInput schema / properties / frame_url
      Added value: +{
      +  "title": "Frame Url",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv1.6.0
    • addedInput schema / properties / include_source_site
      Added value: +{
      +  "default": false,
      +  "title": "Include Source Site",
      +  "type": "boolean"
      +}
  3. Changed17 schema fields changedv1.1.1
    • removedInput schema / properties / filter_object_names / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / filter_object_names / default
      Removed value: -null
    • addedInput schema / properties / filter_object_names / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / filter_object_names / type
      Added value: +"array"
    • removedInput schema / properties / filter_property_names / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / filter_property_names / default
      Removed value: -null
    • addedInput schema / properties / filter_property_names / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / filter_property_names / type
      Added value: +"array"
    • removedInput schema / properties / key_filter / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / key_filter / default
      Removed value: -null
    • addedInput schema / properties / key_filter / type
      Added value: +"string"
    • removedInput schema / properties / tag_filter / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / tag_filter / default
      Removed value: -null
    • addedInput schema / properties / tag_filter / type
      Added value: +"string"
    • removedInput schema / properties / type_filter / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / type_filter / default
      Removed value: -null
    • addedInput schema / properties / type_filter / type
      Added value: +"string"
  4. Addedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

The description discloses key behavioral details: route interception only catches post-registration requests, scripts run in the main world, fallback behavior on AST errors, and the meaning of frame_index. However, it omits potential side effects like performance impact or error responses, but given the absence of annotations it still carries a substantial transparency burden.

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?

The description is long but well-organized with clear sections (overview, args, returns, important timing note). It front-loads the core purpose and immediately explains the critical timing constraint. While it could be trimmed, the length is justified given the tool's complexity and 24 parameters.

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 description lacks a detailed output schema specification; it only says 'Returns: dict with action-specific results.' It mentions that logs include tap events and possibly source-site maps, but does not describe the exact event structure, log response format, or error handling. For such a complex tool, this leaves gaps in understanding the expected output.

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

Parameters5/5

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

Every schema parameter (24 total) is described in the Args section, including purpose, defaults, and applicability per action. This goes far beyond the bare parameter names in the schema, adding meaningful context for filter parameters, mode specifics, and the behavior of include_source_site and on_oversized.

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?

The description clearly states the tool's purpose as JSVMP source-level instrumentation, lists the specific actions it performs, and explicitly mentions it replaces four prior tools. This makes the tool's role distinct from siblings like hook_jsvmp_interpreter and trace_property_access.

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?

The description provides explicit timing guidance with an 'IMPORTANT' section explaining the need to call install before navigate for sync-loaded scripts, and gives a concrete pattern (launch_browser, install, navigate). It also explains when to use reload as an alternative and how filters reduce overhead, making usage conditions clear.

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