List documents
list-documentsGet 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
tagslist-account-document-types: uuids for
document_typelist-account-teams: uuids for
teamslist-account-parties: the account's own entities, for
account_partiessearch-external-parties: counterparties, for
external_partiessearch-document-users: people, for
document_users/signatorieslist-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 nullArchived documents:
archived_at is not nullDraft 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 emptyNo language set:
locale is nullA 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 >= 10000Currency 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 (orZ).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 emptyA 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 innot (...)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. Useai_analyses is emptyfor 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.
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": {
"mode": "<mode>"
},
"name": "list-documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | "list" returns matching documents. "describe_fields" returns the fields an expression can use instead, with their operators and allowed values, including this account's metadata fields; it takes no other argument | |
| page | No | Which page of results to fetch | |
| search | No | A fuzzy full-text relevance search across document name, plaintext content and other indexed fields, combined with filter_expression using AND. Only for genuinely free-text conditions: it is NOT a reliable way to match a structured attribute such as a metadata value, party, document user, tag or document type, which belong in filter_expression. If sort_by is not provided, results are returned most relevant first | |
| include | No | Optional sections to include for each document, on top of the default compact summary. Allowed values: parties (the contracting entities, in compact form), teams (the teams the document is assigned to), tags (the account classification labels on the document), details (origin, locale and source template), signing_settings (signature type, sequential signing and the external signatory invitation message), timestamps (created_at, updated_at and archived_at - the last of these tells an archived document from an active one). Only request the sections you actually need; use get-document-info for full information about a single document. | |
| sort_by | No | Sort results by this field. The default is updated_at, or relevance when search is given. Allowed values are any of the static sort fields (name, stage, created_at, updated_at, archived_at, relevance) or any bare metadata field name, e.g. contract_value, not the expression field md.contract_value or md.contract_value.amount returned by describe_fields; relevance requires search | |
| per_page | No | How many results to return on each page | |
| sort_direction | No | The default is: desc | |
| include_metadata | No | Bare metadata field names to return a value for on every document in the response, e.g. contract_value, not the expression field md.contract_value or md.contract_value.amount returned by describe_fields. Request up to 10 fields. Use this whenever you need the same metadata for several documents - it returns those values for the whole page in one call, instead of calling get-document-info once per document. Fetch remaining pages when current_page < max_page to cover all matches. Each requested field is returned for every document, with a null value where that document has no value for it. Only request the fields you actually need: the response grows with per_page × the number of fields | |
| filter_expression | No | The FQL filter expression, see the tool description. Omit it to list every document the user can access, archived ones included |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | No | How many documents match across all pages; present only for mode=list | |
| fields | No | The fields an expression can use; present only for mode=describe_fields | |
| max_page | No | How many pages of results are available; present only for mode=list | |
| documents | No | The matching documents on this page; present only for mode=list | |
| in_app_url | No | A URL that opens the fynk app's documents list with the same filter, search, sorting and pagination applied; present only for mode=list. Give this to the user when they may want to view or work with this list of documents in the fynk app | |
| current_page | No | Which page of results this is; present only for mode=list |