Skip to main content
Glama

Make a template from a document the person already has

import_document

Turn a document the person already sends — their invoice, letterhead, minutes, a form — into a Galley template that reproduces its look, with a JSON Schema you can fill. PDF only (exported from the program that made it, not a scan), up to 10 pages and 20 MB.

Getting the file to Galley — send exactly one:

  • upload: true, the usual answer in a chat. A file the person dropped into the conversation reaches you as pages to read, not as bytes you can pass on, so this returns a one-time upload link (15 minutes, one use) for the person and a curl line for an agent with a shell. Ask the person to open the link and drop the file; then call get_import.

  • file_url, a public https link to the PDF (a share link the person pasted).

  • file_base64, the bytes, up to 5 MB — only for a client that already holds them in code.

Then poll get_import every few seconds; an import is usually ready in a few minutes. Galley may ask up to three questions about what on the page is fixed and what changes (get_import shows each with an image of the region), answer_import answers them, and save_import makes the template once the person has seen the preview. Nothing is a template until it is saved.

Needs a verified account on a paid plan: the keyless trial cannot import (call create_account first), and Free answers plan_required. Each paid plan includes a number of imports a month (twelve times that over the year on an annual plan), counted when one starts — failed and refused imports are not counted — and this answer says how many are left; nothing is billed per import. A document you import is sent to Anthropic's Claude API to be read and converted, under their 30-day retention; Galley deletes its copy within 7 days. Identity, financial and government documents (bank statements, diplomas, tax forms, tickets) are refused.

Input Schema

NameRequiredDescriptionDefault
autoNoSkip the questions: every one takes its recommended answer. Default false. Use it only when the person has said they do not want to be asked.
hintNoWhat kind of document this is, if you know: `invoice`, `quote`, `meeting-minutes`, `letterhead`… A hint for the classifier, never a command; it does not change what the page says.
nameNoName for the template this import will save as, e.g. `ashcroft-invoice`. Optional: save_import can name it too, and the draft proposes one.
uploadNo`true` for a one-time upload link (15 minutes, one use) to give the person, plus a curl line for an agent with a shell. The usual choice in a chat: a file someone dropped into the conversation reaches you as pages to read, not as bytes you can pass on. Send exactly one of `upload`, `file_url` and `file_base64`.
file_urlNoA public https link to the PDF, such as a share link the person pasted. Fetched once, up to 20 MB, from public addresses only.
file_base64NoThe PDF's bytes, base64, at most 5 MB decoded. Only for a client that already holds the bytes in code. A model writing base64 out spends roughly a token for every two or three characters — a 100 KB PDF is tens of thousands of tokens — so in a chat use `upload: true`, and with a shell use its curl line.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false, idempotentHint=false) by disclosing quota accounting ('counted when one starts — failed and refused imports are not counted'), that nothing is billed per import, data handling (sent to Anthropic's Claude API, 30-day retention, Galley deletes its copy within 7 days), refusal categories for sensitive documents, and the one-time 15-minute upload link semantics.

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?

Length is justified by the multi-step workflow, prerequisites and policy surface, and the purpose is front-loaded before the ingestion-modes section. Some content (upload/file_base64 tradeoffs, exactly-one rule) repeats the schema descriptions, which is the only real redundancy.

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?

For a 6-parameter, no-output-schema, open-world tool, the description covers inputs, prerequisites, quota/billing, privacy, refusal behavior, and the follow-up call sequence an agent needs to complete the task. Nothing material is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so the baseline is 3; the description lifts it by explaining the selection logic among upload/file_url/file_base64 and the 'send exactly one' constraint, plus the token-cost rationale against base64. It largely narrates what the schema already documents, so it stops short of a 5.

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

Purpose5/5

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

Opens with a specific verb+resource: turning an existing document into a Galley template that reproduces its look and yields a fillable JSON Schema. It also implicitly separates itself from create_template (from scratch) and save_import (the finalization step) by noting 'Nothing is a template until it is saved.'

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

Usage Guidelines5/5

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

Explicitly states when to use each ingestion path (upload for chat, file_url for a pasted link, file_base64 only when a client holds bytes in code) and enforces 'send exactly one.' It also gives the downstream sequence (poll get_import, answer_import, save_import), the create_account prerequisite, and the plan_required failure mode.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources