Skip to main content
Glama
camoufox-reverse-mcp

camoufox-reverse-mcp

inject_hook_preset

Injects pre-built JavaScript hooks into the page's main world to log XHR, fetch, crypto, WebSocket, cookie, and runtime activity, with optional persistence across new documents.

Instructions

Inject a pre-built hook into the page main world.

Presets run where page scripts run (v1.10.0; before, they ran in the isolated world and recorded none of the page's own calls). Page code can detect the replaced functions; remove_hooks() restores them in the current document.

Available presets (log location in brackets, read it with evaluate_js("window. || []", world="main")): - "xhr": XMLHttpRequest requests [__mcp_xhr_log]. - "fetch": fetch requests [__mcp_fetch_log]; get_request_initiator also reads its stacks. - "crypto": btoa/atob/JSON.stringify inputs and outputs [__mcp_crypto_log]. - "websocket": WebSocket connections and messages [__mcp_ws_log]. - "debugger_bypass": strip debugger from Function(...) and timers. - "cookie" (alias "cookie_hook"): document.cookie reads/writes [__mcp_cookie_log]. - "runtime_probe": XHR/fetch/canvas/WebGL/navigator/listener calls [__mcp_runtime_log].

Args: preset: One of the above preset names. persistent: True (default) also installs it in every new document, including same-origin iframes; False installs it in the current document only.

Returns: dict with status, preset, world, execution_backend and read_with.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "preset": "<preset>"
    },
    "name": "inject_hook_preset"
  }
}

Input Schema

NameRequiredDescriptionDefault
presetYes
persistentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it discloses main-world execution semantics, the v1.10.0 behavior change, the critical caveat that page code can detect replaced functions, and that remove_hooks() restores them in the current document. Persistence scope (same-origin iframes, new documents) is also made explicit.

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?

Front-loads the action and behavior caveats, then uses a scannable preset list, then Args and Returns sections with no filler. The v1.10.0 historical parenthetical is marginally useful to an agent and is the only sentence that could be trimmed.

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 2-param mutation-style tool with no annotations and no output schema, the definition covers setup, side effects, reversibility, read path, and even the return dict fields (status, preset, world, execution_backend, read_with). Nothing an agent needs to invoke it correctly is missing.

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?

Schema description coverage is 0%, so the description must compensate, and it does: it documents the exact allowed preset strings with what each one captures and where, plus the alias "cookie_hook". The persistent flag is explained with its default and its concrete effect (install in every new document including same-origin iframes vs current document only).

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?

States a specific verb and target ("Inject a pre-built hook into the page main world") and then enumerates the exact preset set, so an agent knows precisely what capability this exposes. It also names where the resulting logs live, which distinguishes it from generic evaluation siblings.

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

Usage Guidelines4/5

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

Gives concrete when-to-use routing per preset (e.g. "fetch": get_request_initiator also reads its stacks) and tells the agent how to read results via evaluate_js("window.<name> || []", world="main") and how to undo via remove_hooks(). It stops short of explicitly contrasting with hook_function for custom (non-preset) hooks, which is the main gap.

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