write_record
Create or update a single record in a PocketBase collection by specifying collection, action, and data. Use create for new records or update with record_id to modify existing ones.
Instructions
USE WHEN you need to create or update a single record.
EXAMPLES:
Create: write_record(collection="posts", action="create", data={"title": "Hi", "body": "..."})
Update: write_record(collection="posts", action="update", record_id="abc", data={"title": "New"})
NEXT STEPS: find_records to verify, describe_collection for field names.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection": "<collection>",
"action": "<action>",
"data": "<data>"
},
"name": "write_record"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Field values to set. For update, include only fields to change. | |
| action | Yes | Whether to create a new record or update an existing one. | |
| expand | No | Comma-separated relation fields to expand in the response. | |
| record_id | No | Required for action='update'. The id of the record to update. | |
| collection | Yes | Collection name or id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||