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'
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'replaces all fields', implying a destructive mutation, but doesn't mention permissions, side effects, error handling, or response format. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature (replaces all fields), no annotations, and no output schema, the description is incomplete. It fails to address critical aspects like what happens to existing data, atomicity hints from 'transactionId', or return values, leaving significant gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description adds no additional meaning beyond implying that 'data' contains the new values and 'recordId' identifies the target, which is already clear from the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Replace') and resource ('all fields of a record'), making the purpose specific. However, it doesn't explicitly differentiate from sibling tools like 'UpdateRecord' or 'CreateRecord', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'UpdateRecord' or 'CreateRecord'. It lacks context about prerequisites, exclusions, or typical scenarios, leaving the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/rush-db/RushDB'

If you have feedback or need assistance with the MCP directory API, please join our Discord server