Get a paginated list of the documents available to the current user.
Use this tool when:
- You need to find a document_uuid to use as input for another tool
- You need to know which documents the current user has access to, or which match some conditions
- You want to count documents matching some conditions (read `total`)
- You need the same information about several documents: use include and include_metadata rather than calling get-document-info once per document
Without filter_expression, every document the user can access is returned, archived ones included, with the most recently updated first. For ordinary requests, add `archived_at is null` as described below. Each document is returned as a compact summary; use include to request additional sections (parties, teams, tags, details, signing_settings, timestamps) and include_metadata to return named metadata values for every document.
`total` counts all matching documents, but documents and their metadata are returned only for the current page. Fetch the remaining pages while current_page < max_page when you need the complete set, including when calculating totals from metadata such as contract value.
# Discover before writing an expression
Call this tool with mode="describe_fields" before writing an expression that uses metadata (`md.*`), option values, or a field you are unsure of: it lists every field documents can be filtered on in this account, with its operators and allowed values, including the account's metadata fields. Metadata names and select options differ per account, so never guess them.
Accounts classify their documents using structures they define themselves, and the words a user puts in a question are usually labels their account already uses. "our customers", "suppliers", "key accounts", "renewals", "EMEA" and "high value" sound like descriptions of content but are far more likely to be a tag, a document type, or a metadata field or option. These lookups are cheap and return small, complete lists, so look rather than guess:
- list-account-tags: uuids for `tags`
- list-account-document-types: uuids for `document_type`
- list-account-teams: uuids for `teams`
- list-account-parties: the account's own entities, for `account_parties`
- search-external-parties: counterparties, for `external_parties`
- search-document-users: people, for `document_users` / `signatories`
- list-templates, search-automations, search-imports: uuids for `template`, `automation`, `import`
When a question groups documents into a category that is not represented by a document type, check list-account-tags before treating that category as free text.
# Decompose the request, then map every part to a condition
Split the request into its conditions, find the structured field each one corresponds to, and combine them all in one expression. "what logo usage rights do we have for our largest customers?" is three conditions: "customers" (likely a tag or document type), "largest" (a currency metadata field: a range condition, or sort_by that field) and "logo usage rights" (possibly a metadata field). Answering with just one of them silently answers a different question.
The search argument is a fuzzy full-text search over document name, content and other indexed fields. Use it only for genuinely free-text conditions; for a document name use `name contains "..."`, and never use search for something a field covers. Loose or topical phrasing such as "anything to do with Acme" or "documents about product variant Alpha" does not make a condition free text: check for a structured field or value first. If search returns no results, check whether the term is a tag, document type, metadata value or party before concluding nothing matches.
# FQL syntax
`and`, `or`, `not`, parentheses; `=`, `!=`, `<`, `<=`, `>`, `>=`; `field in ("a", "b")`; text `contains` / `starts with` / `ends with` (literal, case-insensitive); collections `tags contains "<uuid>"`, `contains any (...)`, `contains all (...)`; `is null`, `is not null`, `is empty`, `is not empty`; object collections `exists(collection, predicate)` and `all(collection, predicate)`; `start_of("week"|"month"|"quarter"|"year"[, offset])`, `end_of(...)` (same arguments), `today()`, `days_ago(N)`, `days_from_now(N)`, `now()`, `current_account_user()`. Metadata fields are `md.<name>`, or `md["<name>"]` when the name contains anything other than ASCII letters, digits and underscores; use field names exactly as mode="describe_fields" returns them, money components `md.<name>.amount`, `.currency`, `.interval`. Use double-quoted strings. Dates and timestamps are double-quoted ISO 8601 strings; a date-only operand, `today()`, `days_ago(N)`, `days_from_now(N)` or `end_of(...)` (the period's last day) against a timestamp field covers that whole calendar day, exactly like the quoted date (so `created_at = today()` matches anything created today, `created_at = days_ago(1)` anything created yesterday, and `created_at >= days_ago(7)` anything created since the start of the day 7 days ago), while `start_of(...)` resolves to the period's first midnight. The optional signed offset of `start_of` and `end_of` counts whole periods from the current one: `start_of("month", 1)` is the start of next month, `end_of("quarter", -1)` the last day of last quarter. Duration operands are double-quoted ISO durations, e.g. `md.<field> = "P10M"` for ten months. Not every operator applies to every field: the operators mode="describe_fields" lists for a field are the ones it accepts.
# FQL examples
## Single conditions
- Active documents: `archived_at is null`
- Archived documents: `archived_at is not null`
- Draft documents: `stage = "draft"`
- Name contains NDA: `name contains "NDA"`
- German documents across regional locales: `locale starts with "de"`
- A specific document type: `document_type = "{document_type_uuid}"`
## Tags, teams and missing values
- Either tag: `tags contains any ("{tag_a_uuid}", "{tag_b_uuid}")`
- Both tags: `tags contains all ("{tag_a_uuid}", "{tag_b_uuid}")`
- Neither tag: `not (tags contains any ("{tag_a_uuid}", "{tag_b_uuid}"))`
- Assigned to a team: `teams contains "{team_uuid}"`
- Unassigned to any team: `teams is empty`
- No language set: `locale is null`
- A language is set: `locale is not null`
## Metadata
Use the account's discovered field names and option values in these examples.
- A select value (with a metadata name requiring bracket notation): `md["tätigkeitsfamilie_it_kv"] = "ZT"`
- An amount of at least 10,000: `md.contract_value.amount >= 10000`
- Currency is EUR: `md.contract_value.currency = "EUR"`
- A duration of ten months: `md.<field> = "P10M"`
- Expiring on a specific date (date metadata): `md.expiration_date = "2026-11-10"`
- Signed at any time on a specific day (system timestamp metadata): `md.signed_date = "2026-11-10"`. A date-only operand matches the whole calendar day in the query timezone.
- Signed at or after a specific instant: `md.signed_date >= "2026-11-10T14:30:00+01:00"`. Timestamp literals include the time and an explicit UTC offset (or `Z`).
- Expired before today: `md.expiration_date < today()`
- Expiring today: `md.expiration_date = today()`
- Expiring tomorrow: `md.expiration_date = days_from_now(1)`
- Expires after today (expiration date set): `md.expiration_date > today()`
- Expiring within the next 30 days, today included: `md.expiration_date >= today() and md.expiration_date <= days_from_now(30)`
- Expiring this month: `md.expiration_date >= start_of("month") and md.expiration_date <= end_of("month")`
- Expiring next quarter: `md.expiration_date >= start_of("quarter", 1) and md.expiration_date <= end_of("quarter", 1)`
- Not expired before today, including documents expiring today or without an expiration date: `not (md.expiration_date < today())`
## Combined conditions
- Active documents in draft or review with NDA in their name: `archived_at is null and stage in ("draft", "review") and name contains "NDA"`
- Assigned to a specific team or unassigned: `teams contains "{team_uuid}" or teams is empty`
- A specific document type with a contract value of at least EUR 10,000: `document_type = "{document_type_uuid}" and md.contract_value.amount >= 10000 and md.contract_value.currency = "EUR"`
- Involving a named counterparty: `exists(external_parties, entity_name = "Acme GmbH")`
- Involving a named person: `exists(document_users, first_name = "Jane" and last_name = "Doe")`
- Involving a person by email: `exists(document_users, email = "jane@example.com")`
- Created last quarter: `created_at >= start_of("quarter", -1) and created_at <= end_of("quarter", -1)`
- Created in the last 30 days or with an open discussion: `created_at >= days_ago(30) or exists(discussions, resolved_at is null)`
## Workflow recipes
- Joined by the current user: `exists(document_users, account_user = current_account_user() and roles contains any ("owner", "collaborator"))`. Wrap in `not (...)` for documents not joined yet, e.g. before joining several with join-document. After joining a page, request page 1 again.
- AI analysis applied: `exists(ai_analyses, status = "applied")` matches any of a document's analyses; `exists(ai_analyses, latest = true and status = "applied")` matches only its latest, the one the app shows the status of. Use `ai_analyses is empty` for documents never analysed.
- Awaiting the current user's signature: `archived_at is null and stage = "signing" and exists(signatories, account_user = current_account_user() and signing_complete = false)`
- Fetch information for known documents: `uuid in ("{uuid_a}", "{uuid_b}")`. Combine with include or include_metadata; UUIDs that do not exist or are not accessible simply do not match. Set per_page to cover the requested UUIDs, up to 50; it defaults to 10 even for a UUID list. Fetch remaining pages when current_page < max_page.
# Parties vs. people
A document's parties (the contracting entities, frequently organizations) are distinct from its signatories and other document users (the individual people on it). To find documents involving a named person in any role, use `document_users`; use `signatories` when the condition specifically concerns that person as a signer. A party field does not match the individual people acting on its behalf. `account_parties` are the account's OWN entities ("our company", "our subsidiary"); `external_parties` are the counterparties. When it is unclear which kind a named entity is, or one lookup returns nothing, check the other kind before concluding there are no matching documents.
# Active vs. archived documents
The app user interface hides archived documents by default. Unless the user asks for archived documents, historical records, or explicitly includes archived documents in a complete inventory, add `archived_at is null`. This also applies to ordinary list and count requests; "all" alone does not imply including archived documents.
No archive condition is applied automatically. Use `archived_at is not null` for archived documents only, or omit the archive condition to include both. Archiving is not deletion: if an active-only search finds nothing, check archived documents before concluding that no matching documents exist.
Whenever results include archived documents, request include=["timestamps"] and clearly identify archived items using archived_at. For counts or aggregates, explicitly state that archived documents are included.