Skip to main content
Glama

get_script_source

Retrieve the original source code of a script using its ID. When source maps exist, returns the pre-compiled code (e.g., TypeScript) for easier debugging.

Instructions

Retrieves the source code for a script. If source maps are available, can return the original source instead of the generated/bundled code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesID of the debugging session.
script_idYesID of the script. Obtain from list_scripts or get_call_stack.
prefer_originalNoIf true and a source map exists, return the original source (e.g., TypeScript). Defaults to true.
Behavior3/5

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

No annotations provided, so description carries full burden. It discloses behavior regarding source maps but omits details like error handling, permissions, or side effects. The read-only nature is implied but not explicit.

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?

Two sentences, no fluff. The main action is front-loaded, and the source map behavior is a concise addition.

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

Completeness3/5

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

No output schema, so description should explain return value, but it does not. It mentions source map handling but omits error cases, permissions, or how script_id is obtained beyond sibling tools.

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 baseline is 3. The description does not add meaning beyond the schema; it merely restates param names. Schema already defines each parameter well.

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 'Retrieves the source code for a script', using a specific verb and resource. It distinguishes itself from siblings like list_scripts or get_call_stack by focusing on source retrieval, and adds nuance about source maps.

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 description implies when to use (when you need source code), but lacks explicit guidance on when not to use or alternatives. No comparison to siblings like get_original_location or evaluate_expression.

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/johngrimes/mcp-js-debugger'

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