Search tasks
distru-search-tasksReadSearches the caller's company's tasks — to-dos assigned to a user with a due date, optionally linked to one record.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Default: 10 |
| cursor | string | No | nextCursor of the previous call; keep the other arguments unchanged. |
| ids | string[] | No | |
| search | string | No | Case-insensitive substring of name. Ranked by name similarity; sortBy ignored. |
| statuses | enum[]ACTIVECOMPLETED | No | |
| ownerIds | string[] | No | Assignees. Resolve via distru-search-users. |
| dueDateAfter | string | No | Inclusive. YYYY-MM-DD (start of day, company timezone) or ISO 8601 with a UTC offset. |
| dueDateBefore | string | No | Inclusive. YYYY-MM-DD (end of day, company timezone) or ISO 8601 with a UTC offset. |
| relatedTypes | enum[]ASSEMBLYBATCHCOMPANYCONTACTINVOICEORDER_SHIPMENTPRODUCTPURCHASE_ORDERREQUESTRETURNSALES_ORDERSTOCK_TRANSFER | No | Tasks linked to any record of these types. Not combinable with the record ID filters (companyIds, salesOrderIds, …). |
| assemblyIds | string[] | No | Resolve via distru-search-assemblies. |
| batchIds | string[] | No | Resolve via distru-search-batches. |
| companyIds | string[] | No | Resolve via distru-search-companies. |
| contactIds | string[] | No | Resolve via distru-search-contacts. |
| invoiceIds | string[] | No | Resolve via distru-search-invoices. |
| productIds | string[] | No | Resolve via distru-search-products. |
| purchaseOrderIds | string[] | No | Resolve via distru-search-purchase-orders. |
| returnIds | string[] | No | Resolve via distru-search-returns. |
| salesOrderIds | string[] | No | Resolve via distru-search-sales-orders. |
| customFields | object[] | No | Set one of contains, anyOf or onOrAfter/onOrBefore per entry. Records with no value for the field never match. |
| customFields[]. | string | Yes | Resolve via distru-search-custom-fields. |
| customFields[]. | string | No | TEXT: case-insensitive substring. |
| customFields[]. | string[] | No | DROPDOWN, CHECKBOX: any of these options, case-sensitive. |
| customFields[]. | string | No | DATE: YYYY-MM-DD, company timezone. |
| customFields[]. | string | No | DATE: YYYY-MM-DD, company timezone. |
| sortBy | object | No | Default UPDATED_AT DESC. Ignored when search is set. |
| sortBy. | enumASCDESC | Yes | |
| sortBy. | enumDUE_DATEINSERTED_ATNAMEUPDATED_AT | Yes |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence |
|---|---|---|
| hasMore | boolean | Always |
| nextCursor | string | Can be absent |
| totalCount | integer | Can be absent |
| items | object[] | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | enumACTIVECOMPLETED | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | enumASSEMBLYBATCHCOMPANYCONTACTINVOICEORDER_SHIPMENTPRODUCTPURCHASE_ORDERREQUESTRETURNSALES_ORDERSTOCK_TRANSFER | Can be null |
| items[]. | object | Null or absent |
| items[]. | string | Always |
| items[]. | string | Null or absent |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | object[] | Always |
| items[]. | object | Always |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | enumCHECKBOXDATEDROPDOWNTEXT | Always |
| items[]. | string | Can be null |
What the AI reads
Searches the caller's company's tasks — to-dos assigned to a user with a due date, optionally linked to one record. Use it to list what is due or overdue, what a user has to do, or what is open on a record. owner is the assignee. The linked record sits under the key for relatedType (company, salesOrder, purchaseOrder, invoice, product, batch, contact, assembly or return); the others are null. It is also null when the caller cannot see it or it was deleted, and for stock transfers, order shipments and requests, which only relatedType names. At most one record ID filter (companyIds, salesOrderIds, purchaseOrderIds, invoiceIds, productIds, batchIds, contactIds, assemblyIds, returnIds).