Skip to main content
Glama

SetRecord

Replace all fields of a database record with new values using a record ID, label, and data object. This tool updates existing records in RushDB's graph database.

Instructions

Replace all fields of a record with provided values

Input Schema

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

Implementation Reference

  • The core handler function that executes the SetRecord tool logic: sets the record data using db.records.set and returns a success message.
    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 tool schema including name, description, and inputSchema for validation in the MCP server.
    { 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:352-366 (registration)
    Registers the tool handler in the MCP server's CallToolRequestSchema switch statement, dispatching arguments to the SetRecord function and formatting the response.
    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 } ] }
  • index.ts:40-40 (registration)
    Imports the SetRecord handler function for use in the MCP server.
    import { SetRecord } from './tools/SetRecord.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