Skip to main content
Glama

Recover Javascript Sources

recover_javascript_sources

Recovers readable modules and source maps from local UTF-8 JavaScript scripts or bundles into an absent output directory without executing application code.

Instructions

Recover readable modules from local UTF-8 JavaScript scripts/bundles into an absent directory, using caller-supplied Wakaru ^1.13.0 (verified with 1.14.0) on Linux x64. Use additional_paths for related chunks; each input retains its own snapshot and provenance. Returns original/derived digests, extraction byte ranges, emitted source maps, warnings and analysis_input inline. Structural splitting may fall back to one module; original names and runtime equivalence remain unknown. No application code execution. Requires util-linux prlimit; one worker, 1 GiB address-space ceiling, 120-second deadline, 64 MiB total input, 128 MiB output, 10000 entries and 8 MiB per diagnostic/report stream.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "/tmp/web-scripts/app.js",
      "output_directory": "/tmp/recovered-app"
    },
    "name": "recover_javascript_sources"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to a UTF-8 JavaScript file; never executed
rewrite_levelNoUpstream syntax recovery level; runtime equivalence remains unverified
extraction_modeNoStructural module boundaries, heuristic fallback, or finer inspection-only regions
additional_pathsNoAdditional absolute UTF-8 JavaScript files recovered together with path; each is snapshotted separately so imports can resolve across related chunks. All inputs share a 64 MiB total budget
output_directoryYesAbsolute absent output directory; parent must exist

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=false and destructiveHint=false, and the description adds substantial context beyond them: no application code execution, the prlimit dependency, one worker, 1 GiB address-space ceiling, 120-second deadline, and explicit input/output/entry/diagnostic budgets. It also discloses the structural-splitting fallback and that original names and runtime equivalence remain unknown, which is exactly the kind of caveat an agent needs; only the failure/error behavior is left implicit.

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-loaded with the core action and target, then requirements, then limits. It is dense but nearly every clause carries operational information; the final sentence packs many limits into one long run-on, which slightly hurts scanability.

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, resource-bounded recovery tool with no output schema, the description covers inputs, environment prerequisites, resource ceilings, fallback behavior, and the shape of returned data (digests, byte ranges, source maps, warnings, analysis_input). An agent has enough to call it correctly and anticipate outcomes.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all five parameters including the extraction_mode and rewrite_level enums. The description adds only marginal meaning, mainly that each input retains its own snapshot and provenance and that inputs share a 64 MiB budget, so the baseline 3 applies.

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

Purpose4/5

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

States a specific verb and resource: 'Recover readable modules from local UTF-8 JavaScript scripts/bundles into an absent directory', plus the required upstream tool (Wakaru) and platform. It is highly specific, but it never names or contrasts a sibling such as analyze_web_bundle, so an agent must infer the boundary itself.

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

Usage Guidelines3/5

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

The only routing guidance is 'Use additional_paths for related chunks', which is parameter usage rather than when-to-use-this-vs-another-tool guidance. There is no statement of when not to use it or which sibling handles adjacent tasks like bundle analysis or runtime observation.

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

Deploy Server

Other Tools