Skip to main content
Glama

CreateRecord

Add new records to your RushDB graph database with structured data and optional transaction support for atomic operations.

Instructions

Create a new record in the database

Input Schema

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

Implementation Reference

  • The main execution logic for the CreateRecord tool, which inserts a new record into the database.
    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}'` } }
  • The tool definition including name, description, and input schema (JSON Schema) for validation.
    { 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 and dispatch logic in the MCP CallToolRequest handler switch statement.
    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}` } ] }
  • index.ts:72-76 (registration)
    Handler for ListToolsRequestSchema that returns the tools array including CreateRecord.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools } })

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