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;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Delete' implies a destructive mutation, the description doesn't specify whether this operation is reversible, what permissions are required, whether there are confirmation prompts, what happens to related data, or what the response looks like. For a destructive tool with zero annotation coverage, this represents a significant gap in behavioral 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?

The description is extremely concise at just three words. Every word earns its place - 'Delete' specifies the action, 'a' indicates singular, and 'record' specifies the resource. There is zero waste or redundancy in this minimal description.

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?

Given that this is a destructive mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens after deletion (success/failure responses), whether the operation is atomic, what error conditions might occur, or how this differs from similar deletion tools. For a tool that permanently removes data, more contextual information is needed.

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?

The input schema has 100% description coverage, with both parameters ('collection' and 'id') clearly documented in the schema. The description adds no additional parameter information beyond what the schema already provides. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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

Purpose3/5

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

The description 'Delete a record' states the verb and resource, making the basic purpose clear. However, it doesn't distinguish this tool from sibling tools like 'delete_collection' or 'truncate_collection' which also perform deletion operations on different resources. The purpose is vague about what type of record is being deleted (database record vs other types).

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. There are multiple sibling tools that could be relevant for deletion operations (delete_collection, truncate_collection) or record operations (update_record, list_records), but the description offers no context about when this specific tool is appropriate versus those alternatives. No prerequisites or exclusions are 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/fadlee/dynamic-pocketbase-mcp'

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