Skip to main content
Glama
mrwyndham

PocketBase MCP Server

delete_record

Remove a specific record from a PocketBase database collection by specifying the collection name and record ID to manage data efficiently.

Instructions

Delete a record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
idYesRecord ID

Implementation Reference

  • The main handler function for the delete_record tool. It uses the PocketBase SDK to delete the record specified by collection and id, and returns a success message or throws an error.
    private async deleteRecord(args: any) { try { await this.pb.collection(args.collection).delete(args.id); return { content: [ { type: 'text', text: `Successfully deleted record ${args.id} from collection ${args.collection}`, }, ], }; } catch (error: unknown) { throw new McpError( ErrorCode.InternalError, `Failed to delete record: ${pocketbaseErrorMessage(error)}` ); } }
  • Input schema for the delete_record tool, specifying collection name and record ID as required string parameters.
    inputSchema: { type: 'object', properties: { collection: { type: 'string', description: 'Collection name', }, id: { type: 'string', description: 'Record ID', }, }, required: ['collection', 'id'], },
  • src/index.ts:272-289 (registration)
    Registration of the delete_record tool in the ListTools response, including name, description, and input schema.
    { name: 'delete_record', description: 'Delete a record', inputSchema: { type: 'object', properties: { collection: { type: 'string', description: 'Collection name', }, id: { type: 'string', description: 'Record ID', }, }, required: ['collection', 'id'], }, },
  • src/index.ts:681-682 (registration)
    Dispatch registration in the CallToolRequest handler switch statement, routing calls to the deleteRecord method.
    case 'delete_record': return await this.deleteRecord(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