Skip to main content
Glama
handoing

Instagram Video Downloader MCP Server

by handoing

download

Download Instagram videos to a local path by providing the video URL and destination directory. Track progress and save content programmatically.

Instructions

Instagram downloader

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDownload local path (e.g. /Users/project/vue, /Users/download)
urlYesInstagram website address (e.g. https://www.instagram.com/p/DHvN6-xygmQ/, https://www.instagram.com/p/DHaq23Oy1iV/)

Implementation Reference

  • index.js:41-53 (handler)
    Handler function for the 'download' tool. Fetches Instagram video data using igdl, validates video URL, downloads the video via helper function, logs progress/errors, and returns success/error message.
    execute: async ({ url, path }, { log, reportProgress }) => {
      try {
        const data = await igdl(url);
        if (!data || !data[0]?.url) {
          throw new UserError("No downloadable video found.");
        }
        await downloadVideo(data[0].url, path, log, reportProgress);
        return 'Instagram download success';
      } catch (e) {
        log.error(`Instagram download error: ${e.message}`);
        return 'Instagram download error';
      }
    },
  • Input schema for the 'download' tool using Zod, defining 'url' (Instagram post URL) and 'path' (local save directory).
    parameters: z.object({
      url: z.string().describe("Instagram website address (e.g. https://www.instagram.com/p/DHvN6-xygmQ/, https://www.instagram.com/p/DHaq23Oy1iV/)")
        .url(),
      path: z.string().describe("Download local path (e.g. /Users/project/vue, /Users/download)"),
    }),
  • index.js:33-54 (registration)
    Registration of the 'download' tool on the FastMCP server, including name, description, input schema, and execute handler.
    server.addTool({
      name: "download",
      description: "Instagram downloader",
      parameters: z.object({
        url: z.string().describe("Instagram website address (e.g. https://www.instagram.com/p/DHvN6-xygmQ/, https://www.instagram.com/p/DHaq23Oy1iV/)")
          .url(),
        path: z.string().describe("Download local path (e.g. /Users/project/vue, /Users/download)"),
      }),
      execute: async ({ url, path }, { log, reportProgress }) => {
        try {
          const data = await igdl(url);
          if (!data || !data[0]?.url) {
            throw new UserError("No downloadable video found.");
          }
          await downloadVideo(data[0].url, path, log, reportProgress);
          return 'Instagram download success';
        } catch (e) {
          log.error(`Instagram download error: ${e.message}`);
          return 'Instagram download error';
        }
      },
    });
  • index.js:9-29 (helper)
    Helper function to download video stream from URL to local file using axios and fs, generates hash-based filename, logs progress and errors.
    async function downloadVideo(url, saveDir, log) {
      try {
        log.info('Starting video download...', { url });
    
        const response = await axios.get(url, { responseType: 'stream' });
    
        const fileName = createHash('sha256').update(url).digest('hex').slice(0, 8) + '.mp4';
        const savePath = path.join(saveDir, fileName);
    
        await new Promise((resolve, reject) => {
          const writer = fs.createWriteStream(savePath);
          response.data.pipe(writer);
          writer.on('finish', resolve);
          writer.on('error', reject);
        });
    
        log.info(`Video download complete! File saved as: ${savePath}`);
      } catch (error) {
        log.error(`Failed to download video: ${error.message}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Instagram downloader' implies a read operation that saves content locally, but it doesn't specify behavioral traits like whether it requires authentication, handles rate limits, supports batch downloads, or what happens on failure. This leaves significant gaps for a tool that likely interacts with external services.

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 extremely concise with just two words, 'Instagram downloader', which is front-loaded and wastes no space. It efficiently conveys the core purpose without unnecessary elaboration, making it easy to parse quickly.

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 complexity of downloading from Instagram (likely involving external APIs, authentication, and file handling), the description is incomplete. No annotations or output schema exist to supplement it, and the description lacks details on what content is downloaded, success/failure behavior, or any operational constraints, making it inadequate for safe and effective use.

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%, with clear descriptions for both parameters (url and path). The description doesn't add any meaning beyond what the schema provides, such as explaining parameter interactions or constraints. With high schema coverage, the baseline is 3, as the schema adequately documents the parameters without extra help from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Instagram downloader' states the general purpose (downloading from Instagram) but lacks specificity about what exactly gets downloaded (e.g., images, videos, posts, stories) and doesn't include a clear verb-resource combination. It's vague but not tautological since it adds 'Instagram' context beyond just the name 'download'.

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?

No guidance is provided on when to use this tool versus alternatives, prerequisites, or limitations. The description doesn't mention any context for usage, such as authentication needs or supported Instagram content types, leaving the agent with no usage instructions.

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

Related 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/handoing/ig-download-mcp-server'

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