Skip to main content
Glama
postgresai

postgresai

Official

download_file

Download a file from PostgresAI storage by full URL or relative path and save it locally; optionally specify organization ID and output path.

Instructions

Download a file from PostgresAI storage by URL (full URL under the storage base, or a relative path like /files/123/foo.png).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "download_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesFull URL (must be under the configured storage base) or relative storage path (e.g. /files/123/foo.png)
debugNoEnable verbose debug logs
org_idNoOrganization ID. Optional with a per-organization token (uses the stored org); REQUIRED with a global token, which can reach every organization the user belongs to and will not assume one. Use orgs_list / `pgai orgs` to discover valid values.
output_pathNoLocal destination path (default: derive filename from URL, save in CWD). When omitted, the path-traversal guard restricts the destination to CWD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden; it does add a real behavioral rule that the URL must resolve under the configured storage base. However, it omits material behavior: that the file is written to local disk (default CWD filename), that a path-traversal guard applies, and what happens on denied or missing paths — those details live only in the schema.

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?

One front-loaded sentence with the resource and its accepted input forms, and no filler. Nothing can be trimmed without losing the storage-base constraint.

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?

For a simple retrieval tool with a rich schema this is close to sufficient, and no output schema means return values need not be explained. The significant gap is that the description never mentions the local-write side effect or the traversal guard, which an agent needs before invoking it.

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%, so all four parameters are already documented in structured form, including org_id token semantics and the CWD default. The description only restates the accepted URL format, adding little beyond the schema and repeating the relative-path example verbatim.

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 gives a specific verb and resource ('Download a file from PostgresAI storage') plus the accepted URL forms, so an agent knows exactly what the tool retrieves. It does not name a sibling such as upload_file or list_report_files to mark the boundary, so it stops short of 5.

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?

Usage is implied by the URL-based framing, but there is no explicit statement of when to prefer this over listing tools or when it should not be used. No preconditions (e.g., authentication or access to the storage base) are spelled out in the description itself.

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