Skip to main content
Glama
fadlee

PocketBase MCP Server

by fadlee

delete_record

Remove a specific record from a PocketBase collection by providing the collection name and record ID to manage database content.

Instructions

Delete a record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
idYesRecord ID

Implementation Reference

  • Factory function that creates the ToolHandler for the delete_record tool, which deletes the specified record from a PocketBase collection.
    export function createDeleteRecordHandler(pb: PocketBase): ToolHandler { return async (args: DeleteRecordArgs) => { try { await pb.collection(args.collection).delete(args.id); return createJsonResponse({ success: true, message: `Record '${args.id}' deleted successfully from collection '${args.collection}'` }); } catch (error: unknown) { throw handlePocketBaseError("delete record", error); } }; }
  • JSON Schema for input validation of the delete_record tool, requiring 'collection' and 'id' parameters.
    export const deleteRecordSchema = { type: "object", properties: { collection: { type: "string", description: "Collection name", }, id: { type: "string", description: "Record ID", }, }, required: ["collection", "id"], };
  • src/server.ts:144-148 (registration)
    Registers the delete_record tool in the MCP server with its name, description, input schema, and handler function.
    name: "delete_record", description: "Delete a record", inputSchema: deleteRecordSchema, handler: createDeleteRecordHandler(pb), },
  • TypeScript interface defining the input arguments for the delete_record handler.
    export interface DeleteRecordArgs { collection: string; id: string; }

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

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