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);

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