Skip to main content
Glama

update_record

Modify existing records within a specified resource by providing the resource URI, record ID, and updated data. Ensures accurate and efficient record management within the MCP Template server.

Instructions

Update a record in a resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesNew record data
recordIdYesID of the record to update
resourceUriYesURI of the resource

Implementation Reference

  • The handler for the 'update_record' tool. Validates input using UpdateRecordArgsSchema and calls this.dataService.updateRecord to perform the update.
    case 'update_record': {
      return await safeExecute(toolName, async () => {
        const args = validateInput(UpdateRecordArgsSchema, request.params.arguments);
        const record = await this.dataService.updateRecord(args.resourceUri, args.recordId, args.data);
        return record;
      });
    }
  • Registration of the 'update_record' tool in the list_tools handler, including name, description, and input schema reference.
      name: 'update_record',
      description: 'Update a record in a resource',
      inputSchema: getInputSchema(UpdateRecordArgsSchema),
    },
  • Zod schema defining the input arguments for the update_record tool: resourceUri, recordId, and data.
    export const UpdateRecordArgsSchema = z.object({
      resourceUri: z.string().describe('URI of the resource'),
      recordId: z.string().describe('ID of the record to update'),
      data: z.record(z.unknown()).describe('New record data'),
    });
  • Implementation of the updateRecord method in the InMemoryDataService, which is called by the tool handler to perform the actual record update in memory.
    public async updateRecord(
      uri: string, 
      id: string, 
      data: Record<string, unknown>
    ): Promise<Record<string, unknown>> {
      this.validateResource(uri);
      
      const resourceData = this.data.get(uri)!;
      const existingRecord = resourceData.get(id);
      
      if (!existingRecord) {
        throw new Error(`Record not found: ${id}`);
      }
      
      const updatedRecord = {
        ...existingRecord,
        ...data,
        id, // Ensure ID doesn't change
        updatedAt: new Date().toISOString()
      };
      
      resourceData.set(id, updatedRecord);
      return updatedRecord;
    }
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 updates a record but does not cover critical aspects like required permissions, whether the update is idempotent, error handling, or what happens on success/failure. This is a significant gap for a mutation tool.

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 is front-loaded and directly states the tool's purpose without unnecessary elaboration, 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 tool's complexity (a mutation with three required parameters), lack of annotations, and no output schema, the description is incomplete. It fails to address behavioral traits, usage context, or return values, leaving the agent with insufficient information for reliable invocation.

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?

The schema description coverage is 100%, with clear descriptions for all three parameters (resourceUri, recordId, data). The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, so it 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 action ('Update') and the target ('a record in a resource'), distinguishing it from siblings like create_record or delete_record. However, it lacks specificity about what 'update' entails beyond the basic verb, such as whether it's a full or partial update, which could help differentiate it further.

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?

No guidance is provided on when to use this tool versus alternatives like create_record or delete_record. The description does not mention prerequisites (e.g., needing an existing record) or exclusions, leaving the agent to infer usage from the tool name alone.

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

Related 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/kbhuw/MCP_TEMPLATE'

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