Skip to main content
Glama

insync_download_document

Read-only

Downloads a patient portal document by folder URL and file name, saving it locally or returning it inline or as a signed link on hosted servers.

Instructions

Download a document filed to the patient’s portal account. Identify it by the folder_url and file_name from insync_list_documents (full view). On a local install the file is saved to disk and the path returned; on a hosted server it comes back inline (up to 10 MiB), or as a short-lived signed download link when larger. The download goes through the portal — never direct storage.

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": {
      "folder_url": "<folder_url>",
      "file_name": "<file_name>"
    },
    "name": "insync_download_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_nameYesThe document’s FileName from insync_list_documents (full view).
folder_urlYesThe document’s DstFolderURL from insync_list_documents (full view).
output_dirNoDirectory to save into (local install only; ignored on a hosted server, which returns the file inline or as a link). Defaults to INSYNC_OUTPUT_DIR or ~/Downloads; must resolve inside an allowed root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedInput schema / properties / output_dir / description
      Previous value: -"Directory to save into (local install only; ignored on a hosted server, which returns bytes inline). Defaults to INSYNC_OUTPUT_DIR or ~/Downloads; must resolve inside an allowed root."New value: +"Directory to save into (local install only; ignored on a hosted server, which returns the file inline or as a link). Defaults to INSYNC_OUTPUT_DIR or ~/Downloads; must resolve inside an allowed root."
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Although annotations already mark this read-only and non-destructive, the description adds genuinely new behavioral facts: environment-dependent output (disk path vs inline vs signed link), a 10 MiB inline cap, short-lived link expiry, and that traffic is proxied through the portal rather than direct storage.

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?

Four tight sentences, front-loaded with purpose then identification source then return behavior. No filler, and the environment-dependent outcome is stated compactly in one clause.

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

Completeness5/5

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

With no output schema, the description carries the burden of explaining return values and does so fully: path on local install, inline payload under 10 MiB, signed link above that. An agent knows what it will receive in every deployment mode.

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 100% and the parameter descriptions already explain provenance and the output_dir fallback/root constraint, so the schema does the heavy lifting. The description only reinforces the '(full view)' source hint without adding syntax or format detail beyond it.

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 document filed to the patient's portal account') and ties identification to insync_list_documents. It does not explicitly contrast itself with the very similar sibling insync_download_attachment, leaving the document-vs-attachment split implicit.

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 a concrete prerequisite path: obtain folder_url and file_name from insync_list_documents (full view) before calling. It stops short of an explicit exclusion, e.g. 'for message attachments call insync_download_attachment instead'.

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