Skip to main content
Glama
mabeldata

PocketBase MCP Server

by mabeldata

update_record

Update an existing record in a PocketBase collection by providing its ID and the fields to modify. Use this to modify specific records in your PocketBase database.

Instructions

Update an existing record in a PocketBase collection by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesThe name or ID of the PocketBase collection.
idYesThe ID of the record to update.
dataYesThe data fields to update (key-value pairs).

Implementation Reference

  • Core handler function that validates required args (collection, id, data) and calls PocketBase's update method.
    async function updateRecord(args: UpdateRecordArgs, pb: PocketBase): Promise<ToolResult> {
        if (!args.collection || !args.id || !args.data) {
            throw invalidParamsError("Missing required arguments: collection, id, data");
        }
        const record = await pb.collection(args.collection).update(args.id, args.data);
        return {
            content: [{ type: 'text', text: JSON.stringify(record, null, 2) }],
        };
    }
  • TypeScript interface defining the expected arguments for the update_record tool.
    export interface UpdateRecordArgs {
      collection: string;
      id: string;
      data: any;
    }
  • Tool metadata registration including name, description, and input JSON schema for the update_record tool.
    {
        name: 'update_record',
        description: 'Update an existing record in a PocketBase collection by ID.',
        inputSchema: {
            type: 'object',
            properties: {
                collection: { type: 'string', description: 'The name or ID of the PocketBase collection.' },
                id: { type: 'string', description: 'The ID of the record to update.' },
                data: { type: 'object', description: 'The data fields to update (key-value pairs).', additionalProperties: true },
            },
            required: ['collection', 'id', 'data'],
        },
    },
  • Routing in the central tool handler: routes update_record calls to handleRecordToolCall.
    if (name === 'fetch_record' || name === 'list_records' || name === 'create_record' || name === 'update_record') {
  • Top-level registration function that collects all tool definitions (including update_record via listRecordTools).
    export function registerTools(): { tools: ToolInfo[] } { // Use ToolInfo[]
        const tools: ToolInfo[] = [ // Use ToolInfo[]
            ...listRecordTools(),
            ...listCollectionTools(),
            ...listFileTools(),
            ...listMigrationTools(), // Uncommented
            ...listLogTools(), // Add log tools
            ...listCronTools(), // Add cron tools
        ];
        return { tools };
    }
Behavior2/5

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

No annotations provided; description only states 'update' without disclosing side effects, permissions, or error handling. Minimal transparency.

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?

Single sentence, no extraneous words, front-loaded with essential information.

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?

Despite full schema coverage, the description lacks details on return values, validation behavior, or what happens when fields are missing. Incomplete for a mutation tool.

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 coverage is 100%; each parameter has a description. The tool description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

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

Purpose5/5

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

Clear verb 'update', specific resource 'record', and method 'by ID'. Distinguishes from sibling tools like create_record and fetch_record.

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 on when to use this tool versus alternatives, no prerequisites or exclusions mentioned.

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

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