Skip to main content
Glama
mrwyndham

PocketBase MCP Server

update_record

Modify existing records in PocketBase collections by specifying the collection name, record ID, and updated data fields.

Instructions

Update an existing record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
idYesRecord ID
dataYesUpdated record data

Implementation Reference

  • The main handler function for the update_record tool, which calls PocketBase to update the record in the specified collection.
    private async updateRecord(args: any) {
      try {
        const result = await this.pb
          .collection(args.collection)
          .update(args.id, args.data);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to update record: ${pocketbaseErrorMessage(error)}`
        );
      }
    }
  • Tool definition including name, description, and input schema for update_record, registered in the tools list.
    {
      name: 'update_record',
      description: 'Update an existing record',
      inputSchema: {
        type: 'object',
        properties: {
          collection: {
            type: 'string',
            description: 'Collection name',
          },
          id: {
            type: 'string',
            description: 'Record ID',
          },
          data: {
            type: 'object',
            description: 'Updated record data',
          },
        },
        required: ['collection', 'id', 'data'],
      },
    },
  • src/index.ts:679-680 (registration)
    Registration/dispatch case in the CallToolRequestHandler switch statement that routes to the updateRecord method.
    case 'update_record':
      return await this.updateRecord(request.params.arguments);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool performs an update operation but doesn't mention permission requirements, whether changes are reversible, potential side effects, 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 no wasted words. It's appropriately sized for a basic tool description and gets straight to the point without unnecessary elaboration.

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?

For a mutation tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens during updates, error conditions, or return values. The agent lacks crucial information about how this tool behaves in practice.

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 already documents all three parameters (collection, id, data). The description adds no additional meaning about parameter usage, relationships, or constraints beyond what the schema provides, meeting the baseline for high schema coverage.

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

Purpose3/5

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

The description 'Update an existing record' clearly states the action (update) and target (record), but it's vague about what constitutes a 'record' in this context and doesn't distinguish from sibling tools like update_collection. It avoids tautology but lacks specificity about the resource being modified.

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 about when to use this tool versus alternatives like create_record or delete_record, nor about prerequisites such as authentication or existing record requirements. The description offers no context for appropriate usage scenarios.

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/mrwyndham/pocketbase-mcp'

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