Skip to main content
Glama

SetRecord

Replace all fields of a record with new values in RushDB's graph database, using the record ID, label, and data to perform atomic updates.

Instructions

Replace all fields of a record with provided values

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe new record data to set
labelYesLabel for the record
recordIdYesID of the record to set
transactionIdNoOptional transaction ID for atomic set

Implementation Reference

  • The core handler function that implements the SetRecord tool by setting the record data in the database using db.records.set.
    export async function SetRecord(params: { recordId: string label: string data: Record<string, any> transactionId?: string }) { const { recordId, label, data, transactionId } = params await db.records.set({ target: recordId, label, data }, transactionId) return { success: true, message: `Record '${recordId}' set successfully with label '${label}'` } }
  • Defines the input schema, description, and registration entry for the SetRecord tool within the central tools array.
    { name: 'SetRecord', description: 'Replace all fields of a record with provided values', inputSchema: { type: 'object', properties: { recordId: { type: 'string', description: 'ID of the record to set' }, label: { type: 'string', description: 'Label for the record' }, data: { type: 'object', description: 'The new record data to set' }, transactionId: { type: 'string', description: 'Optional transaction ID for atomic set' } }, required: ['recordId', 'label', 'data'] } },
  • index.ts:72-76 (registration)
    Registers the tools list (including SetRecord schema) for MCP's ListTools request handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools } })
  • The switch-case dispatcher in the MCP CallToolRequest handler that invokes the SetRecord function.
    case 'SetRecord': const setResult = await SetRecord({ 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: setResult.message } ] }

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