Search lab test results
distru-search-test-resultsReadSearches lab test results — the potency records a COA file can be attached to.
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. |
| batchIds | string[] | No | Filter to results that apply to any of these batches: uploaded to the batch or inherited from the batches it was assembled from. Resolve via distru-search-batches. |
| packageIds | string[] | No | Filter to results that apply to any of these packages: uploaded to the package or inherited from the packages it was split or assembled from. Resolve via distru-search-packages. |
| productIds | string[] | No | Filter to results uploaded to a batch or package of any of these products, not ones they only inherited (use batchIds / packageIds for those). Resolve via distru-search-products. |
| sortBy | object | No | Sort options. Defaults to most recently updated first when omitted. |
| sortBy. | enumASCDESC | Yes | |
| sortBy. | enumINSERTED_ATNAMEUPDATED_AT | Yes | Field to sort by. NAME orders by the test result name. |
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[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | string | Can be null |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
| items[]. | string | Can be null |
| items[]. | object | Can be null |
| items[]. | string | Always |
| items[]. | string | Always |
What the AI reads
Searches lab test results — the potency records a COA file can be attached to. Returns one row per result: name, lab name, release date, THC %, total THC %, CBD % and total CBD % (each null when not recorded), and where the result was uploaded: `batch` or `package`, the other one null. `package` is often a lab sample package split off for testing; the result then also applies to the package it was split from, unless the sample was made outside Distru. A result also applies to the packages and batches made from the one it was uploaded to, so batchIds / packageIds can return results uploaded elsewhere. A result uploaded to a package never applies to a batch, not even the package's own. If the user's teams can't see every batch and package: batchIds / packageIds skip the ones they can't see and return every result applying to the rest; without those filters only results uploaded to a batch or package they can see are returned, even if a result also applies to a visible one. `batch` / `package` is null when the user's teams can't see it. Results default to most recently updated first. Requires authentication via Authorization header.