Skip to main content
Glama

Extract Original Sources

sourcemap_extract_sources

Extract embedded original source files from a source map to disk, writing each sourcesContent entry while preserving directory structure and handling webpack://, file://, and relative path prefixes.

Instructions

Extract all embedded original source files from a source map to disk. Writes each sourcesContent entry as a file, preserving the directory structure. Handles webpack://, file://, and relative path prefixes. Use this after fetching a source map to get the full original source tree.

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": {
      "file": "<file>"
    },
    "name": "sourcemap_extract_sources"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to a source map file (.map)
outputDirNoDirectory to extract source files to (default: /tmp/srcmap-sources)/tmp/srcmap-sources

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, consistent with a filesystem-writing tool, so the description does not contradict them. It adds useful behavior beyond the annotations: directory-structure preservation and handling of webpack://, file://, and relative prefixes. It omits what happens when outputDir already contains files (overwrite? merge?) and what happens if sourcesContent is missing, which are the main risks for a write tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, front-loaded with the action and its effect, then path handling, then usage timing. No filler or redundant restatement of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with no output schema, the description covers the action, the destination, path normalization, and when to use it. It stops short of saying what the call returns (file count, extracted paths, or errors) and how pre-existing output directories are treated.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is lenient, but the description still adds meaning beyond it: the path-prefix handling tells an agent that webpack:// and file:// sources will be normalized rather than erroring, and 'preserving the directory structure' explains what outputDir will actually contain.

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 ('Extract all embedded original source files from a source map to disk') with the downstream effect clarified ('Writes each sourcesContent entry as a file'). The 'to disk' framing functionally separates it from a sibling like sourcemap_sources that presumably just lists source names, though no sibling is named explicitly.

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?

'Use this after fetching a source map to get the full original source tree' gives clear sequencing context and an intended outcome, which is enough to pick it over a listing or lookup tool. There is no when-not guidance (e.g., what to do if sourcesContent is absent, or if sourcemap_sources is the better read-only choice).

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