Skip to main content
Glama

get_script_source

Retrieve JavaScript script source code by URL or ID, supporting line ranges for normal files or character offsets for minified single-line files to analyze WeChat MiniApp code.

Instructions

Gets a snippet of a JavaScript script source by URL (recommended) or script ID. Supports line range (for normal files) or character offset (for minified single-line files).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
script_idNo
urlNo
start_lineNo
end_lineNo
offsetNo
lengthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool 'gets a snippet' and supports different extraction methods, but doesn't disclose important behavioral traits like whether this is a read-only operation, potential rate limits, authentication requirements, error conditions, or what happens with invalid inputs. The description is insufficient for a mutation-sensitive agent.

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?

The description is efficiently structured in a single sentence that packs essential information: purpose, primary parameters, and usage guidance for different file types. Every word earns its place with zero redundancy or unnecessary elaboration.

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?

Given the tool's moderate complexity (6 parameters, no annotations, but with output schema), the description provides adequate but incomplete context. It covers parameter purposes and some usage guidance but lacks behavioral transparency details. The presence of an output schema reduces the need to describe return values, but more operational context would be helpful.

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?

With 0% schema description coverage, the description adds significant value by explaining parameter semantics. It clarifies that 'script_id' and 'url' are alternative identifiers (with URL recommended), explains that 'start_line' and 'end_line' are for normal files while 'offset' is for minified single-line files, and implies 'length' controls snippet size. This compensates well for the schema's lack of descriptions.

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 description clearly states the tool's purpose: 'Gets a snippet of a JavaScript script source' with two identification methods (URL or script ID). It specifies the resource (JavaScript script source) and verb (gets a snippet), but doesn't explicitly differentiate from sibling tools like 'search_in_sources' or 'list_scripts' beyond the snippet extraction aspect.

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 provides some usage context by recommending URL over script ID and explaining when to use line range vs. character offset. However, it doesn't explicitly state when to use this tool versus alternatives like 'search_in_sources' or 'list_scripts', nor does it mention prerequisites or exclusions.

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/zhizhuodemao/miniapp-cdp-mcp'

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