Skip to main content
Glama

save_script_source

Save the full JavaScript or WebAssembly source to a local file for detailed analysis, with support for formatting minified code.

Instructions

Saves one complete JavaScript or WASM source for local inspection when an inline snippet is insufficient, especially for large or minified bundles. Prefer get_script_source for a small known region and search_in_sources to locate text across loaded scripts first. With format=true, destinations using a supported JavaScript/TypeScript extension are formatted by default; other extensions preserve raw source, and formatted line numbers may differ from the live page. Use distinctive text plus the original URL with set_breakpoint_on_text for runtime debugging. The returned filename is the resolved local path, while scriptId remains scoped to the current debugger context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL from list_scripts, search_in_sources, or a call stack. Preferred over scriptId because it can be resolved again after navigation; exact match is tried before substring match.
formatNoFormat supported JavaScript/TypeScript extensions for readability (default: true). Set false when exact source bytes or original line layout matter; formatted line numbers cannot be used as live breakpoint locations.
filePathYesDestination path for the complete source, absolute or relative to the server working directory and subject to --allowedRoots. A JavaScript/TypeScript extension enables formatting; use .wasm for bytecode or another extension to preserve raw text.
scriptIdNoDebugger-context-scoped script ID from list_scripts or search_in_sources. Use for unnamed inline/eval scripts; it becomes invalid after reload, navigation, or debugger target/frame change.
confirmOverwriteNoSet true only to authorize replacing an existing filePath. A new file does not require overwrite confirmation.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool completed successfully.
dataNoMachine-readable result payload.
toolYesStable MCP tool name.
errorNo
summaryYesConcise human-readable outcome.
Behavior4/5

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

The description discloses key behaviors: formatted line numbers may differ from live page, filePath is the resolved local path, and scriptId is scoped to current debugger context and becomes invalid after navigation/refresh. Annotations show readOnlyHint=false and destructiveHint=false, which are consistent. One minor gap: it doesn't mention that the saved file persists or any access restrictions beyond --allowedRoots.

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 detailed but every sentence is informative. It is front-loaded with the main purpose. While slightly long, it avoids redundancy. Could be trimmed slightly, but overall effective.

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?

Given 5 parameters with rich schema, output schema present, the description covers purpose, sibling differentiation, behavioral nuances, and parameter semantics. It mentions the returned filename implicitly. No obvious gaps for the tool's complexity.

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 coverage is 100%, but the description adds significant context for each parameter. For url, it explains preferred source and matching strategy. format is described with clear use cases. filePath explains extension implications. scriptId clarifies scoping and invalidation. confirmOverwrite notes authorization. This goes well beyond the schema.

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 that the tool saves a complete JavaScript or WASM source for local inspection when an inline snippet is insufficient. It differentiates from siblings by mentioning 'Prefer get_script_source for a small known region and search_in_sources to locate text across loaded scripts first.' The specific verb 'saves' and resource 'source' make purpose unambiguous.

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 usage guidance is provided: prefer get_script_source for small regions, use search_in_sources first, and use set_breakpoint_on_text for debugging. It also clarifies when to set format=false and when to use confirmOverwrite. This helps the agent decide when to invoke this tool over its siblings.

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/zhizhuodemao/js-reverse-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server