Skip to main content
Glama

UpdateRecord

Modify existing records in RushDB by updating specific fields without replacing entire entries, using partial data updates for targeted changes.

Instructions

Update an existing record (partial update)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordIdYesID of the record to update
labelYesLabel for the record
dataYesThe updated (partial) record data
transactionIdNoOptional transaction ID for atomic update

Implementation Reference

  • The main handler function for the UpdateRecord tool. It updates a record in the database using the provided recordId, label, and data, optionally within a transaction, and returns a success message.
    export async function UpdateRecord(params: {
      recordId: string
      label: string
      data: Record<string, any>
      transactionId?: string
    }) {
      const { recordId, label, data, transactionId } = params
    
      await db.records.update({ target: recordId, label, data }, transactionId)
    
      return {
        success: true,
        message: `Record updated successfully`
      }
    }
  • The JSON schema definition and metadata for the UpdateRecord tool, used for input validation and tool listing in MCP.
    {
      name: 'UpdateRecord',
      description: 'Update an existing record (partial update)',
      inputSchema: {
        type: 'object',
        properties: {
          recordId: { type: 'string', description: 'ID of the record to update' },
          label: { type: 'string', description: 'Label for the record' },
          data: { type: 'object', description: 'The updated (partial) record data' },
          transactionId: { type: 'string', description: 'Optional transaction ID for atomic update' }
        },
        required: ['recordId', 'label', 'data']
      }
    },
  • index.ts:152-166 (registration)
    The dispatch case in the CallToolRequest handler that registers and invokes the UpdateRecord tool handler during MCP tool calls.
    case 'UpdateRecord':
      const updateResult = await UpdateRecord({
        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: updateResult.message
          }
        ]
      }
  • index.ts:28-28 (registration)
    Import statement that brings the UpdateRecord handler into the main index for use in tool dispatching.
    import { UpdateRecord } from './tools/UpdateRecord.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 'partial update' but doesn't clarify what that entails (e.g., merges vs. overwrites), permissions required, error handling (e.g., if recordId doesn't exist), or side effects. For a mutation tool, this leaves critical behavioral traits undocumented, though it correctly implies a write operation.

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 waste. It front-loads the core purpose ('Update an existing record') and adds a clarifying detail ('partial update') without redundancy. Every word earns its place, making it easy to parse quickly.

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 complexity of a mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavior (e.g., error cases, side effects), output expectations, or integration with sibling tools like transactions. While concise, it doesn't provide enough context for safe and effective use in this environment.

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 minimal value beyond the schema by implying 'partial update' relates to the 'data' parameter, but it doesn't explain semantics like what 'partial' means or how 'transactionId' affects atomicity. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Update') and resource ('an existing record'), with the qualifier '(partial update)' adding specificity about the update type. It distinguishes from siblings like 'SetRecord' (which might imply full replacement) and 'CreateRecord' (new records). However, it doesn't explicitly contrast with all alternatives like 'BulkCreateRecords' or 'DeleteRecord'.

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. It doesn't mention prerequisites (e.g., needing an existing record ID), exclusions (e.g., not for bulk updates), or comparisons to siblings like 'SetRecord', 'BulkCreateRecords', or transaction-related tools. Usage is implied by the name but not explicitly stated.

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