Skip to content

Read and write records

List, filter, create, update and delete the records in your app's collections through MCP.

Every record tool takes an entity: the collection name, written exactly as get_schema returns it.

List records#

list_records returns one page of a collection.

Arguments
{"entity":"Order","filters":{"status":"in:new,paid","price":"between:20,90"},"sort":"-created_date","fields":"id,status,price","limit":50,"page":1}
Result
{"items":[],"page":1,"limit":50,"total":0,"pages":0}
  • limit is the number of records per page. The default is 50 and the most is 200.
  • page starts at 1.
  • sort is a field name. Put - in front for descending order.
  • fields is a comma-separated list of the fields to return.
  • search is a free-text search.

Filters#

filters maps a field name to a condition. A bare value means "equals". For anything else, write the operator, a colon, and the value.

OperatorMeaningExample
eqEquals"status": "eq:paid"
neNot equal"status": "ne:cancelled"
gtGreater than"price": "gt:100"
gteGreater than or equal"price": "gte:100"
ltLess than"price": "lt:100"
lteLess than or equal"price": "lte:100"
likeContains"name": "like:smith"
inOne of a comma-separated list"status": "in:new,paid"
betweenBetween two values"price": "between:20,90"

Count records#

count_records takes the same filters and search as list_records and returns how many records match, without returning them.

Get one record#

get_record returns a single record by id.

Create records#

create_record creates one record. data holds the fields, and it has to match the collection's fields from get_schema. For a relation field, pass the id of the related record.

Arguments
{"entity":"ContactMessage","data":{"email":"dana@example.com","message":"Hello"}}

create_records creates up to 100 records in one call. Pass them as items. The result says which records were created and which failed.

Update a record#

update_record is a partial update: only the fields you send in data change.

Delete a record#

delete_record deletes one record by id. The assistant confirms with you before it calls this tool.