Skip to main content
Glama

Export records as a file

well_export_data
Read-only

Export a full list of Well records (transactions, invoices, companies, people) as a file, and return the link that downloads it. Use it when the person asks for their whole list rather than an answer about it: "send me every transaction of June", "export my unpaid invoices".

Name the root and the fields as well_query_records takes them, with the same whereClause. Pass format for a PDF; a CSV comes back when you name none. An invoice, a credit note, or a document of a saved design, asked as a PDF, is well_generate_document, not this tool. For rows you built yourself rather than Well records, use well_export_rows_as_file.

The link lives 15 minutes and serves a few downloads. Share it only with the person who asked.

Returns url, or refusal_reason: "not_a_member" (the caller is not an active member of this workspace), "query_refused" (the query names something the records read model refuses; the error says what), "unavailable" (this deployment cannot serve files) or "failed" (Well could not make the file; the same call can be tried again).

When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.

Input Schema

NameRequiredDescriptionDefault
kpisNoUp to 3 figures Well computes and prints above the table.
rootNoThe records root to export, as well_query_records takes it: transactions, invoices, companies…
titleYesThe title the file prints, in the user's language: "Transactions de juin 2026".
fieldsNoThe file's columns, in order, 1 to 8 field paths.
formatNoOnly when the person named a format: "pdf" for a PDF, "csv" for a CSV or a spreadsheet. Well then sends the file itself. Left out, the person picks the format under your message.
sourceNo"records" (the default) exports a records query. "cash_position" exports the bank accounts a cash position counted, each with its balance, read by Well: pass `title` and `account_types`, and no records query.
orderByNoThe row order: { "field": "executed_at", "direction": "desc" }.
file_kindNoOnly when a skill names it: "receivables_aging" for the receivables aging file (`invoices` root). Well then names the file aging, the day, the time and the sources of its rows. Left out, the file is named after its root.
partyScopeNo`invoices` root only: "purchase" for supplier invoices, "sales" for client invoices.
as_of_monthNoCash position only: the past month the answer read the balance at the end of, as `YYYY-MM`, when the person asked for a month end ("fin du mois dernier"). The file then prints each account's balance at that month end. Left out, the file prints the live balance.
whereClauseNoThe filter, as well_query_records takes it: { "executed_at": { "_gte": "2026-06-01", "_lt": "2026-07-01" } }.
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose which.
account_typesNoCash position only: the account types the answer counted as cash, as the cash scope keys them (["deposit"]), never a label. Required for `source: "cash_position"`.
column_labelsNoThe column headings, in the user's language, one per field and in the same order.
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.

Output Schema

NameRequiredDescriptionDefault
urlYesThe link that downloads the export. Give it to the person exactly as returned.
errorNo
formatNoThe format the file comes in.
successYes
expires_atNoWhen the link stops working, ISO 8601.
refusal_reasonNo
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / file_kind
      Added value: +{
      +  "description": "Only when a skill names it: \"receivables_aging\" for the receivables aging file (`invoices` root). Well then names the file aging, the day, the time and the sources of its rows. Left out, the file is named after its root.",
      +  "enum": [
      +    "receivables_aging"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/destructiveHint false, but the description adds real behavior: the download link expires in 15 minutes, serves only a few downloads, and should be shared only with the requester. It also enumerates the failure modes with meanings (not_a_member, query_refused, unavailable, failed) and says a failed call is retryable, plus the workspace selection rule. This is well beyond what annotations convey.

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-loaded with purpose and usage rule, then routing exceptions, then failure modes, then workspace behavior — a sensible ordering that lets an agent stop reading early. It is dense with zero filler, though the return-value sentence partially duplicates the output schema and the four-paragraph length is at the upper edge of what is needed.

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 16-parameter tool with nested objects, an output schema, and full annotation coverage, the description still supplies the things structured fields cannot: link lifetime, share restrictions, sibling routing, retryability, and the single-vs-multiple-workspace calling rule. Nothing an agent needs to invoke it correctly appears missing.

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 coverage is 100%, so the baseline is 3, but the description adds cross-tool semantics the schema cannot: root, fields, and whereClause must match how well_query_records takes them, and format defaults to CSV when omitted. It does not touch kpis, source, file_kind, partyScope, as_of_month, or column_labels, leaving those entirely to the schema, so it is not 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 and resource ("Export a full list of Well records ... as a file") plus the concrete artifact returned ("the link that downloads it"). It then names the two nearest siblings, well_generate_document and well_export_rows_as_file, so an agent can separate this from document generation and from exporting agent-built rows without opening a schema.

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?

Gives an explicit selection rule ("when the person asks for their whole list rather than an answer about it") backed by two quoted user phrasings. It also states the exclusion: an invoice, credit note, or saved-design document requested as a PDF is well_generate_document, not this tool, and rows you built yourself go to well_export_rows_as_file.

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