Skip to main content
Glama
fadlee

PocketBase MCP Server

by fadlee

delete_collection

Remove a collection from PocketBase by specifying its name or ID. This tool helps manage database structure by eliminating unwanted collections and their associated data.

Instructions

Delete a collection from PocketBase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name or ID to delete

Implementation Reference

  • The handler function that performs the deletion of a PocketBase collection using pb.collections.delete() and returns a success message or throws handled errors.
    export function createDeleteCollectionHandler(pb: PocketBase): ToolHandler {
      return async (args: { collection: string }) => {
        try {
          await pb.collections.delete(args.collection);
          return createJsonResponse({
            success: true,
            message: `Collection '${args.collection}' deleted successfully`
          });
        } catch (error: unknown) {
          throw handlePocketBaseError("delete collection", error);
        }
      };
  • The input schema for the delete_collection tool, requiring a 'collection' string parameter.
    export const deleteCollectionSchema = {
      type: "object",
      properties: {
        collection: {
          type: "string",
          description: "Collection name or ID to delete",
        },
      },
      required: ["collection"],
    };
  • src/server.ts:99-104 (registration)
    The registration of the 'delete_collection' tool in the MCP server, specifying name, description, input schema, and handler.
    {
      name: "delete_collection",
      description: "Delete a collection from PocketBase",
      inputSchema: deleteCollectionSchema,
      handler: createDeleteCollectionHandler(pb),
    },
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. It states the action ('Delete') but lacks critical details: it does not specify if deletion is permanent or reversible, what permissions are required, how it affects associated data (e.g., records in the collection), or error handling (e.g., for non-existent collections). This is a significant gap for a destructive operation.

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, direct sentence with zero wasted words, efficiently conveying the core action and target. It is front-loaded and appropriately sized for a simple tool, making it easy for an agent to parse quickly without unnecessary elaboration.

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 destructive tool with no annotations and no output schema, the description is incomplete. It lacks essential context: it does not explain the consequences of deletion (e.g., data loss, irreversibility), required permissions, or what the response might include (e.g., success confirmation or error details). This leaves the agent under-informed for safe and effective 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?

The schema description coverage is 100%, with the parameter 'collection' clearly documented as 'Collection name or ID to delete'. The description adds no additional semantic context beyond this, such as format examples or constraints (e.g., case-sensitivity). Given the high schema coverage, a baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the action ('Delete') and the resource ('a collection from PocketBase'), making the purpose specific and unambiguous. It distinguishes itself from sibling tools like 'truncate_collection' (which removes data but not the collection) and 'delete_record' (which targets individual records).

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. It does not mention prerequisites (e.g., needing authentication or admin rights), exclusions (e.g., not for system collections), or related tools like 'truncate_collection' for removing data without deletion, leaving the agent to infer usage from context alone.

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