# List Folders

`lawmatics_list-folders` · Lawmatics MCP tool · Folders

List folders from Lawmatics with optional pagination, filtering, and sorting. Rows carry the folder name, timestamps, and a `relationships` envelope of to-one {id,type} pointers (the owning matter/contact and the parent folder); use get-folder for the full envelope including child folders and files. To list the folders belonging to one record (a matter or contact), filter on documentable_id with that record's id. You can also filter on created_at / updated_at by date.

## Input

- **page** `integer` (> 0) — Page number (1-based)
- **filter** `object` — Optional single-field filter; one filter at a time
  - **field** `string` (required, enum: "documentable_id", "created_at", "updated_at") — Field to filter on: documentable_id (numeric id of the record — a matter/prospect or contact — the folder belongs to; the way to list one record's folders), created_at, or updated_at (dates)
  - **operator** `string` (enum: "=", "!=", "<", "<=", ">", ">=", "null", "not_null") — Comparison operator. Omit to use the Lawmatics per-field default (= for documentable_id). Use = for documentable_id and a range operator (e.g. >=) for created_at / updated_at
  - **value** `string` (required) — Value to compare against (ignored for null / not_null operators)
- **sortBy** `string` (enum: "id", "created_at", "updated_at") — Column to sort by
- **sortOrder** `string` (enum: "asc", "desc") — Sort direction; ascending or descending

## Output

- **folders** `array` (required) — Folders on this page of results
  - **[]** `object`
    - **id** `string` (required) — Unique ID of the folder
    - **name** `string` (required) — Folder name as stored (Lawmatics replaces slashes with colons)
    - **createdAt** `string | null` (required) — When the folder was created, as an ISO 8601 timestamp; null if unknown
    - **updatedAt** `string | null` (required) — When the folder was last updated, as an ISO 8601 timestamp; null if unknown
    - **relationships** `object` (required) — To-one JSON:API relationship pointers as {id,type} stubs. Not materialized — follow a pointer by calling that resource's own tool. List rows carry to-one pointers only; use get-folder for the full envelope incl. to-many (files, child folders).
      - **documentable** `object | null` (required) — Owning record pointer — the matter/prospect or contact this folder belongs to; null when unset
        - **id** `string` (required) — ID of the referenced Lawmatics record
        - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
      - **parentFolder** `object | null` (required) — Parent folder pointer when this folder is nested; null when it is at the top level
        - **id** `string` (required) — ID of the referenced Lawmatics record
        - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
- **pagination** `object | null` (required) — Pagination metadata from the API response; null when the endpoint returns no meta envelope
  - **totalPages** `number | null` (required) — Total number of pages available
  - **limitPerPage** `number | null` (required) — Maximum folders returned per page; null if not reported
  - **totalEntries** `number | null` (required) — Total number of folders across all pages
