Skip to main content
Glama

TransactionBegin

Start a database transaction to manage data operations with atomicity and consistency in RushDB's graph database.

Instructions

Begin a new database transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ttlNoTTL in milliseconds

Implementation Reference

  • The core handler function that implements the TransactionBegin tool logic, initiating a database transaction with optional TTL.
    export async function TransactionBegin(params: { ttl?: number }) {
      const { ttl } = params
    
      const config = ttl ? { ttl } : undefined
      const transaction = await db.tx.begin(config)
    
      return {
        success: true,
        transactionId: transaction.id,
        message: `Transaction started with ID: ${transaction.id}`
      }
    }
  • Input schema for the TransactionBegin tool defining the optional 'ttl' parameter of type number.
    inputSchema: {
      type: 'object',
      properties: { ttl: { type: 'number', description: 'TTL in milliseconds' } },
      required: []
    }
  • tools.ts:422-430 (registration)
    Registration entry for TransactionBegin in the tools array used for MCP listTools response.
    {
      name: 'TransactionBegin',
      description: 'Begin a new database transaction',
      inputSchema: {
        type: 'object',
        properties: { ttl: { type: 'number', description: 'TTL in milliseconds' } },
        required: []
      }
    },
  • index.ts:480-491 (registration)
    Dispatch case in MCP CallToolRequestSchema handler that invokes the TransactionBegin tool.
    case 'TransactionBegin':
      const beginResult = await TransactionBegin({
        ttl: args.ttl as number | undefined
      })
      return {
        content: [
          {
            type: 'text',
            text: `${beginResult.message}\nTransaction ID: ${beginResult.transactionId}`
          }
        ]
      }
  • index.ts:48-48 (registration)
    Import statement for the TransactionBegin handler function.
    import { TransactionBegin } from './tools/TransactionBegin.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