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);

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