Skip to main content
Glama

download_file

Downloads a file from a URL or link/image selector into the output directory using current cookies and proxy; works when the browser cancels its own download handling.

Instructions

Download a file into the output dir. target is a URL or a selector/ref of a link or image (its href/src is used). The fetch runs inside the current page, so it reuses the session's cookies and proxy; for cross-origin files navigate to that site first. (CloakBrowser cancels the browser's own download handling, so clicking a download link does not save anything: use this instead.)

Input Schema

NameRequiredDescriptionDefault
max_mbNo
targetYes
filenameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Adds substantial behavior beyond what annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false) convey: the fetch executes inside the current page, inherits session cookies and proxy, has cross-origin constraints, and is the only working path for downloads since native download handling is disabled. That is exactly the context an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the action and the target semantics, then adds the cross-origin caveat and the rationale parenthetical. Dense but each sentence carries information; the parenthetical is slightly long but justifies its presence.

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

Completeness4/5

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

An output schema exists, so return values need no explanation, and the definition covers session reuse and cross-origin behavior thoroughly. The only real hole is the unexplained `max_mb` cap and default filename behavior, which an agent would want to know before large downloads.

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 coverage is 0%, so the description must carry the weight; it explains `target` well (URL vs. selector/ref, href/src extraction) but says nothing about `max_mb` or `filename`, leaving two of three parameters undocumented in both schema and description.

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?

States a specific verb and resource ('Download a file into the output dir') and clarifies exactly what `target` accepts. It does not name its closest siblings (save_pdf, save_html, screenshot_file), but the purpose is distinct enough that an agent would not confuse it with them.

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

Usage Guidelines4/5

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

Gives explicit routing guidance: cross-origin files require navigating to that site first, and 'use this instead' when clicking a download link, because CloakBrowser cancels native download handling. Strong for the main decision, though it does not cover when to prefer save_pdf/save_html over this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.