Skip to main content

Record CRUD

Basic operations on records: create, read, update, and delete.

Record Structure

Entity fields are stored inside data:

{
"id": "6bd2d1db-d104-4a15-977a-a759c38608a9",
"entityId": "79d376b6-b00d-4d07-83b6-62276bc57fee",
"name": "Test Company S.L.",
"data": {
"nombre": "Test Company S.L.",
"email": "test@company.com",
"phone": "+34 912345678"
},
"createdAt": "2026-02-03T12:51:15.352Z",
"updatedAt": "2026-02-03T12:51:15.352Z"
}

Important: Access fields via record.data.email, NOT record.email.


create_record

Profile: core

Creates a new record in an entity.

Parameters

ParameterTypeRequiredDescription
entityNamestringYesEntity name
dataobjectYesRecord data (entity fields)

Example

create_record({
entityName: "clientes",
data: {
nombre: "Maria Lopez",
email: "maria@example.com",
telefono: "+54 11 9876-5432",
estado: "activo"
}
})

Response

{
"success": true,
"message": "Record created in clientes",
"record": {
"id": "uuid-del-registro",
"nombre": "Maria Lopez",
"email": "maria@example.com",
"telefono": "+54 11 9876-5432",
"estado": "activo"
}
}

Use get_entity_schema first to know the required fields.


query_records

Profile: core

Queries records from an entity with filters, pagination, sorting, and semantic search.

Parameters

ParameterTypeRequiredDescription
entityNamestringYesEntity name
filterstringNoSimple filter (see Filters)
limitnumberNoMaximum records. Default: 50, max: 200
offsetnumberNoOffset for pagination
orderBystringNoField to sort by
orderDirstringNoDirection: "asc" or "desc"
semanticstringNoNatural language semantic search
minSimilaritynumberNoSimilarity threshold (0-1) for semantic search

Basic Example

query_records({
entityName: "clientes",
limit: 20,
orderBy: "nombre",
orderDir: "asc"
})

Example with Filter

query_records({
entityName: "clientes",
filter: "estado = activo",
limit: 10
})
query_records({
entityName: "productos",
semantic: "muebles de oficina modernos",
minSimilarity: 0.7,
limit: 5
})

Response

{
"entityName": "clientes",
"total": 3,
"records": [
{
"id": "uuid",
"nombre": "Maria Lopez",
"email": "maria@example.com",
"estado": "activo"
}
]
}

For semantic search, each record includes a similarity field with the score.


update_record

Profile: core

Updates an existing record. Only send the fields to modify (partial update).

Parameters

ParameterTypeRequiredDescription
entityNamestringYesEntity name
recordIdstringYesRecord ID
dataobjectYesFields to update

Example

update_record({
entityName: "clientes",
recordId: "uuid-del-registro",
data: {
estado: "inactivo",
email: "maria.nueva@example.com"
}
})

Response

{
"success": true,
"message": "Record uuid-del-registro updated",
"record": {
"id": "uuid-del-registro",
"nombre": "Maria Lopez",
"email": "maria.nueva@example.com",
"estado": "inactivo"
}
}

delete_record

Profile: core

Deletes a record. This action cannot be undone.

Parameters

ParameterTypeRequiredDescription
entityNamestringYesEntity name
recordIdstringYesRecord ID

Example

delete_record({
entityName: "clientes",
recordId: "uuid-del-registro"
})

Response

{
"success": true,
"message": "Record uuid-del-registro deleted from clientes",
"deleted": true
}
Creado con Fyso