Skip to main content
Glama

js.download

Download JavaScript files from URLs for security analysis and vulnerability testing in bug bounty hunting workflows.

Instructions

Download JavaScript file from URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the JS file

Implementation Reference

  • Handler function that downloads JavaScript file from the given URL using axios, stores the content in Redis working memory, and returns a formatted ToolResult with success status, content details, or error message.
    async ({ url }: any): Promise<ToolResult> => {
      try {
        const response = await axios.get(url, {
          timeout: 30000,
          headers: {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
          },
        });
    
        const content = response.data;
        await setWorkingMemory(`js:${url}`, content, 3600);
    
        return formatToolResult(true, {
          url,
          content,
          length: content.length,
          contentType: response.headers['content-type'],
        });
      } catch (error: any) {
        return formatToolResult(false, null, error.message);
      }
    }
  • Input schema definition for the 'js.download' tool, specifying a required 'url' string property.
    {
      description: 'Download JavaScript file from URL',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string', description: 'URL of the JS file' },
        },
        required: ['url'],
      },
    },
  • src/tools/js.ts:9-43 (registration)
    Direct registration of the 'js.download' tool on the MCP Server instance, including schema and handler function.
    server.tool(
      'js.download',
      {
        description: 'Download JavaScript file from URL',
        inputSchema: {
          type: 'object',
          properties: {
            url: { type: 'string', description: 'URL of the JS file' },
          },
          required: ['url'],
        },
      },
      async ({ url }: any): Promise<ToolResult> => {
        try {
          const response = await axios.get(url, {
            timeout: 30000,
            headers: {
              'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
            },
          });
    
          const content = response.data;
          await setWorkingMemory(`js:${url}`, content, 3600);
    
          return formatToolResult(true, {
            url,
            content,
            length: content.length,
            contentType: response.headers['content-type'],
          });
        } catch (error: any) {
          return formatToolResult(false, null, error.message);
        }
      }
    );
  • src/index.ts:36-36 (registration)
    Invocation of registerJsTools(server) which registers the 'js.download' tool among other JS tools.
    registerJsTools(server);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action (download) but lacks critical behavioral details: whether it handles authentication, rate limits, error conditions (e.g., invalid URLs), output format (e.g., file content or saved path), or network constraints. For a download tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place without redundancy or unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (a download operation with potential network/security implications), no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, output format, or integration context, leaving gaps for an AI agent to understand how to use it effectively.

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?

The input schema has 100% description coverage, with the 'url' parameter fully documented. The description adds no additional parameter semantics beyond what the schema provides (e.g., no details on URL validation or supported protocols). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't detract either.

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 'Download JavaScript file from URL' clearly states the action (download) and resource (JavaScript file from URL). It distinguishes from siblings like js.analyze or js.beautify by focusing on retrieval rather than analysis or transformation. However, it doesn't explicitly differentiate from potential similar tools like render.execute_js which might also fetch JS content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., valid URL format), when not to use it (e.g., for non-JS files), or suggest sibling tools for related tasks like js.extract_secrets or js.find_endpoints. Usage is implied but not explicitly defined.

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/telmon95/VulneraMCP'

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