Gets a small snippet of a JavaScript script source by URL (recommended) or script ID. Supports line range (for normal files) or character offset (for minified single-line files). Prefer using url over scriptId — URLs remain stable across page navigations while script IDs become invalid after relo...
AI agents call get_script_source to retrieve information from JS Reverse MCP without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
This tool retrieves and queries JavaScript source code for debugging and analysis purposes with no side effects. It reads existing script content from web pages without altering state, executing code, or triggering external operations.
From the tool's definition Tool description explicitly states it 'Gets a small snippet of a JavaScript script source' and is 'designed for reading small code regions.' The parameters (startLine/endLine, offset/length) are for retrieval bounds only.
Risk signalsBulk/mass operation — affects multiple targets
Attacks that exploit this kind of access
Gets a small snippet of a JavaScript script source by URL (recommended) or script ID. Supports line range (for normal files) or character offset (for minified single-line files). Prefer using url over scriptId — URLs remain stable across page navigations while script IDs become invalid after reload. This tool is designed for reading small code regions (e.g. around breakpoints or search results); specify startLine/endLine or offset/length for predictable inline output. If no range is provided, small sources are returned inline and large sources return a preview with guidance. To read an entire script file, especially a minified one, use save_script_source instead. WASM scripts cannot be shown inline; use save_script_source with a .wasm file path. It is categorised as a Read tool in the JS Reverse MCP MCP Server, which means it retrieves data without modifying state.
Register the JS Reverse MCP server in PolicyLayer and add a rule for get_script_source: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches JS Reverse MCP. Nothing to install.
get_script_source is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_script_source rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get_script_source. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get_script_source is provided by the JS Reverse MCP server (zhizhuodemao/js-reverse-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.