Skip to main content
Glama

CreateRecord

Add new records to your RushDB graph database by specifying labels and data fields for structured storage.

Instructions

Create a new record in the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesLabel for the record
dataYesThe record data to insert
transactionIdNoOptional transaction ID for atomic creation

Implementation Reference

  • The main handler function that executes the CreateRecord tool logic by calling db.records.create to insert a new record.
    export async function CreateRecord(params: {
      label: string
      data: Record<string, any>
      transactionId?: string
    }) {
      const { label, data, transactionId } = params
    
      const result = await db.records.create({ label, data }, transactionId)
    
      return {
        success: true,
        id: result.id(),
        message: `Record created successfully with label '${label}'`
      }
    }
  • JSON schema definition for the CreateRecord tool input, used for validation in the MCP tool list.
    {
      name: 'CreateRecord',
      description: 'Create a new record in the database',
      inputSchema: {
        type: 'object',
        properties: {
          label: { type: 'string', description: 'Label for the record' },
          data: { type: 'object', description: 'The record data to insert' },
          transactionId: { type: 'string', description: 'Optional transaction ID for atomic creation' }
        },
        required: ['label', 'data']
      }
    },
  • index.ts:137-150 (registration)
    Registration of the CreateRecord handler in the MCP server's CallToolRequestSchema switch dispatcher.
    case 'CreateRecord':
      const createResult = await CreateRecord({
        label: args.label as string,
        data: args.data as Record<string, any>,
        transactionId: args.transactionId as string | undefined
      })
      return {
        content: [
          {
            type: 'text',
            text: `${createResult.message}\nID: ${createResult.id}`
          }
        ]
      }

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