UpdateRecord
Modify existing records in RushDB by providing record ID, label, and partial data updates. Supports optional transaction IDs for atomic operations.
Instructions
Update an existing record (partial update)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The updated (partial) record data | |
| label | Yes | Label for the record | |
| recordId | Yes | ID of the record to update | |
| transactionId | No | Optional transaction ID for atomic update |
Implementation Reference
- tools/UpdateRecord.ts:17-31 (handler)Core handler function that performs the record update using the database utility.export async function UpdateRecord(params: { recordId: string label: string data: Record<string, any> transactionId?: string }) { const { recordId, label, data, transactionId } = params await db.records.update({ target: recordId, label, data }, transactionId) return { success: true, message: `Record updated successfully` } }
- tools.ts:89-102 (schema)Input schema definition for the UpdateRecord tool, used for validation and tool listing.{ name: 'UpdateRecord', description: 'Update an existing record (partial update)', inputSchema: { type: 'object', properties: { recordId: { type: 'string', description: 'ID of the record to update' }, label: { type: 'string', description: 'Label for the record' }, data: { type: 'object', description: 'The updated (partial) record data' }, transactionId: { type: 'string', description: 'Optional transaction ID for atomic update' } }, required: ['recordId', 'label', 'data'] } },
- index.ts:152-166 (registration)Registration and dispatching of the UpdateRecord tool call within the MCP server's callTool handler.case 'UpdateRecord': const updateResult = await UpdateRecord({ recordId: args.recordId as string, label: args.label as string, data: args.data as Record<string, any>, transactionId: args.transactionId as string | undefined }) return { content: [ { type: 'text', text: updateResult.message } ] }