Skip to main content
Glama
mabeldata

PocketBase MCP Server

by mabeldata

update_record

Modify an existing record in a PocketBase collection by specifying the collection name, record ID, and the data fields to update.

Instructions

Update an existing record in a PocketBase collection by ID.

Input Schema

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

Implementation Reference

  • Core handler function that performs the PocketBase record update and returns the updated record as JSON.
    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 input arguments for the update_record tool.
    export interface UpdateRecordArgs {
      collection: string;
      id: string;
      data: any;
    }
  • JSON schema for input validation of the update_record tool, used in tool registration.
    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'],
    },
  • ToolInfo object registering the update_record tool with name, description, and schema.
    {
        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'],
        },
    },
    // Add delete_record later if needed
  • Routing logic in central tool handler that directs update_record calls to the record tools handler.
    if (name === 'fetch_record' || name === 'list_records' || name === 'create_record' || name === 'update_record') {
        return handleRecordToolCall(name, toolArgs, pb);
    } else if (name === 'get_collection_schema' || name === 'list_collections') {
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 mentions the tool updates an existing record, implying mutation, but doesn't cover critical aspects like required permissions, whether updates are partial or complete, error handling, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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, well-structured sentence that efficiently conveys the core functionality without unnecessary words. It's front-loaded with the key action and resource, 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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., permissions, side effects), response format, or error conditions. Given the complexity of updating records in a database context, more completeness is needed to guide effective tool use.

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 three parameters. The description adds minimal value beyond the schema by mentioning 'by ID' (implied in the schema) and 'PocketBase collection' (already in schema for 'collection'). It doesn't provide additional context like format examples or constraints, so the baseline score of 3 is appropriate.

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 ('existing record in a PocketBase collection by ID'), making the purpose immediately understandable. It distinguishes from sibling 'create_record' by specifying 'existing record' rather than creation. However, it doesn't explicitly differentiate from other update-like operations in the sibling list.

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 'create_record' or 'fetch_record', nor does it mention prerequisites such as needing an existing record ID. It simply states what the tool does without contextual usage instructions.

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

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