Skip to main content
Glama
mrwyndham

PocketBase MCP Server

delete_collection

Remove a collection from PocketBase database by specifying its ID or name. This administrative action permanently deletes the collection and its data.

Instructions

Delete a collection from PocketBase (admin only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionIdOrNameYesID or name of the collection to delete

Implementation Reference

  • The primary handler function that executes the delete_collection tool. It authenticates as an admin using environment variables, deletes the specified collection via the PocketBase SDK, and returns a success message.
    private async deleteCollection(args: any) {
      try {
        // Authenticate with PocketBase as admin (required for collection deletion)
        await this.pb.collection("_superusers").authWithPassword(process.env.POCKETBASE_ADMIN_EMAIL ?? '', process.env.POCKETBASE_ADMIN_PASSWORD ?? '');
        
        // Delete the collection
        await this.pb.collections.delete(args.collectionIdOrName);
        
        return {
          content: [
            {
              type: 'text',
              text: `Successfully deleted collection ${args.collectionIdOrName}`,
            },
          ],
        };
      } catch (error: unknown) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to delete collection: ${pocketbaseErrorMessage(error)}`
        );
      }
    }
  • Input schema definition for the delete_collection tool, specifying the required 'collectionIdOrName' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        collectionIdOrName: {
          type: 'string',
          description: 'ID or name of the collection to delete',
        },
      },
      required: ['collectionIdOrName'],
    },
  • src/index.ts:651-664 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'delete_collection',
      description: 'Delete a collection from PocketBase (admin only)',
      inputSchema: {
        type: 'object',
        properties: {
          collectionIdOrName: {
            type: 'string',
            description: 'ID or name of the collection to delete',
          },
        },
        required: ['collectionIdOrName'],
      },
    },
  • src/index.ts:693-694 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes to the deleteCollection method.
    case 'delete_collection':
      return await this.deleteCollection(request.params.arguments);
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 mentions 'admin only', indicating permission requirements, but lacks details on destructive effects (e.g., whether deletion is permanent, impacts on related records), rate limits, or error handling. This is a significant gap for a mutation tool with zero annotation coverage.

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, efficient sentence with no wasted words. It front-loads the key information (action, resource, admin restriction), making it easy to parse quickly. Every part of the sentence contributes essential context.

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 the tool's complexity as a destructive admin operation with no annotations and no output schema, the description is incomplete. It should cover more behavioral aspects like permanence of deletion, effects on data, or response format. The current description leaves critical gaps 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?

Schema description coverage is 100%, with the parameter 'collectionIdOrName' fully documented in the schema. The description doesn't add any additional meaning or context beyond what the schema provides, such as examples or constraints. Baseline 3 is appropriate when the schema handles parameter documentation effectively.

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

Purpose4/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 resource ('a collection from PocketBase'), making the purpose unambiguous. However, it doesn't explicitly differentiate this tool from sibling tools like 'delete_record' or 'update_collection', which would require a more specific scope or comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes 'admin only', which implies usage context and prerequisites, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'update_collection' or 'delete_record'. The context is implied rather than fully articulated with clear alternatives or exclusions.

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

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