Source Map Parser MCP Server

by MasonChow
Verified

parse_stack

Map error stack traces to source code by parsing line, column numbers, and source map URLs. Includes context lines for precise debugging and returns JSON results for efficient issue resolution.

Instructions

Parse Error Stack Trace

This tool allows you to parse error stack traces by providing the following:

  • A downloadable source map URL.
  • The line and column numbers from the stack trace.

The tool will map the provided stack trace information to the corresponding source code location using the source map. It also supports fetching additional context lines around the error location for better debugging.

Parameters:

  • stacks: An array of stack trace objects, each containing:
    • line: The line number in the stack trace.
    • column: The column number in the stack trace.
    • sourceMapUrl: The URL of the source map file corresponding to the stack trace.
  • ctxOffset (optional): The number of additional context lines to include before and after the error location in the source code. Defaults to 5.

Returns:

  • A JSON object containing the parsed stack trace information, including the mapped source code location and context lines.
  • If parsing fails, an error message will be returned for the corresponding stack trace.

Input Schema

NameRequiredDescriptionDefault
ctxOffsetNoThe number of additional context lines to include before and after the error location in the source code.
stacksYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "ctxOffset": { "default": 5, "description": "The number of additional context lines to include before and after the error location in the source code.", "type": "number" }, "stacks": { "items": { "additionalProperties": false, "properties": { "column": { "description": "The column number in the stack trace.", "type": "number" }, "line": { "description": "The line number in the stack trace.", "type": "number" }, "sourceMapUrl": { "description": "The URL of the source map file corresponding to the stack trace.", "type": "string" } }, "required": [ "line", "column", "sourceMapUrl" ], "type": "object" }, "type": "array" } }, "required": [ "stacks" ], "type": "object" }

You must be authenticated.

Other Tools from Source Map Parser MCP Server

Related Tools

ID: lt5w5lfsjp