bc_api_list
Reads records from any Business Central API List action with OData filter, select, orderby, top and skip, returning JSON rows, etags and paging flags for API pages or queries.
Instructions
Reads records through any Business Central API List action found with bc_api_search, with server-side OData filter, select, orderby, top and skip. Rows come back as JSON objects with the API's field names plus "@odata.etag" for API pages (pass that etag as "If-Match" when modifying the record with bc_api_invoke). totalCount is the number of matching records and hasMore says whether another page exists; top defaults to 10.
Use it for any API page or API query — standard, ISV or custom — including ones bc_query does not know (bc_query covers only the Standard API v2.0 entities). Check field names with bc_api_describe first; a filter on a non-filterable field is rejected. When NOT to use: for tables without an API (bc_data_query runs an AL query over any table), or to change data (bc_api_invoke). Read-only. Runs on BC's own MCP server (BC 29+, API tools enabled); needs no web-client session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Rows to return (default 10). | |
| skip | No | Rows to skip, for paging with top. | |
| filter | No | OData filter, e.g. "city eq 'London'", "amount gt 1000 and open eq true", "contains(tolower(displayName),'contoso')". Operators: eq ne lt le gt ge and or; functions: contains startswith endswith tolower toupper. "or" only on the same field; no "not". Filterable fields are listed by bc_api_describe. | |
| select | No | Comma-separated fields to return, e.g. "number,displayName,balanceDue". Omit for all fields. | |
| company | No | Company to run in (exact, case-sensitive name from bc_list_companies). Defaults to the current session company, then BC_ODATA_COMPANY, then the user's default company in BC. | |
| orderby | No | OData orderby, e.g. "postingDate desc", "city, number". Not every API allows it: use it only when bc_api_describe lists "orderby" for the action. | |
| actionName | Yes | A List_* action name from bc_api_search, e.g. "List_CustomerLedgerEntries_QRY30302". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| company | Yes | ||
| hasMore | Yes | ||
| rowCount | Yes | ||
| actionName | Yes | ||
| totalCount | No |