Skip to main content
Glama

UpdateRecord

Modify existing records in RushDB by updating specific fields without replacing entire entries, using partial data updates for targeted changes.

Instructions

Update an existing record (partial update)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordIdYesID of the record to update
labelYesLabel for the record
dataYesThe updated (partial) record data
transactionIdNoOptional transaction ID for atomic update

Implementation Reference

  • The main handler function for the UpdateRecord tool. It updates a record in the database using the provided recordId, label, and data, optionally within a transaction, and returns a success message.
    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` } }
  • The JSON schema definition and metadata for the UpdateRecord tool, used for input validation and tool listing in MCP.
    { 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)
    The dispatch case in the CallToolRequest handler that registers and invokes the UpdateRecord tool handler during MCP tool calls.
    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 } ] }
  • index.ts:28-28 (registration)
    Import statement that brings the UpdateRecord handler into the main index for use in tool dispatching.
    import { UpdateRecord } from './tools/UpdateRecord.js'

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1pxone/RushDB'

If you have feedback or need assistance with the MCP directory API, please join our Discord server