Skip to main content
Glama

Lookup Original Position

sourcemap_lookup
Read-only

Resolve generated or minified code positions to original source file, line, and column from a source map; optionally return identifier names and surrounding source context.

Instructions

Find the original source position for a generated (minified) position. Given a line and column in the generated/minified file, returns the original source file, line, column, and optionally the identifier name. Use --context to also get surrounding lines of original source code. All positions are 0-based.

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>",
      "line": "<line>",
      "column": "<column>"
    },
    "name": "sourcemap_lookup"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesPath to a source map file (.map)
lineYesGenerated line number (0-based)
columnYesGenerated column number (0-based)
contextNoNumber of context lines to show around the matched position (default: 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. Beyond that, the description discloses the return shape (source file, line, column, optional identifier name) despite there being no output schema, and states the 0-based convention for all positions. It does not say what happens when a position has no mapping, which keeps it at 4.

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?

Three short sentences, front-loaded with the core purpose and the input/output contract before the optional context mode. No filler. The only blemish is the CLI-style '--context' reference, which is slightly off-register for an MCP tool parameter.

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?

With no output schema, the description carries the burden of explaining what comes back, and it does so concisely, plus it pins down 0-based indexing. For a four-parameter read-only lookup that is essentially complete; only unmapped/error behavior is unaddressed.

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 coverage is 100%, so file, line, column, and context are all already documented with 0-based semantics and a default of 5. The description adds only a loose gloss on context ('also get surrounding lines of original source code'), and does so in CLI-flag syntax ('--context') that does not match the actual parameter name. Baseline 3 is appropriate.

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?

The first sentence names a specific verb and resource ('Find the original source position for a generated (minified) position') and the second spells out the exact input (line/column in generated file) and output (original source file, line, column, identifier name). That is far more specific than the title alone. It stops short of naming or differentiating itself from similarly-named siblings such as sourcemap_resolve or sourcemap_mappings, so it does not reach a 5.

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?

The description establishes the triggering scenario clearly: you have a line and column in a generated/minified file and want the original position. It also flags the optional context mode as an add-on. There are no explicit when-not conditions or named alternatives (e.g. resolving a source name back to a generated position), so it is a solid 4 rather than a 5.

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