Skip to main content
Glama
mrwyndham

PocketBase MCP Server

backup_database

Create a backup of your PocketBase database to protect data and enable recovery. Specify a backup name to organize and identify your database snapshots.

Instructions

Create a backup of the PocketBase database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNobackup name

Implementation Reference

  • The handler function that executes the backup_database tool. It authenticates as admin using environment variables and calls PocketBase's backups.create with the provided name (default empty) and empty options, returning the result as text content.
    private async backupDatabase(args: any) {
      try {
        // Authenticate with PocketBase
        await this.pb.collection("_superusers").authWithPassword(process.env.POCKETBASE_ADMIN_EMAIL ?? '', process.env.POCKETBASE_ADMIN_PASSWORD ?? '');
        
        // Create a new backup
        const backupResult = await this.pb.backups.create(args.name ?? '', {});
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(backupResult, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to backup database: ${pocketbaseErrorMessage(error)}`
        );
      }
    }
  • Input schema definition for the backup_database tool, specifying an object with an optional 'name' property of type string.
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'backup name',
        },
      },
    },
  • src/index.ts:595-607 (registration)
    Registration of the backup_database tool in the tools list provided to the MCP server for ListTools requests.
    {
      name: 'backup_database',
      description: 'Create a backup of the PocketBase database',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'backup name',
          },
        },
      },
    },
  • src/index.ts:689-690 (registration)
    Dispatch case in the CallTool request handler that routes calls to the backupDatabase method.
    case 'backup_database':
      return await this.backupDatabase(request.params.arguments);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Create a backup' implies a write operation that likely requires admin permissions and may impact database performance, but none of this is mentioned. The description doesn't disclose whether the backup is immediate or scheduled, if it locks the database, what format it creates, or where backups are stored. For a potentially disruptive operation with zero annotation coverage, this is inadequate.

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 that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple backup operation and front-loads the core functionality. Every word earns its place in this minimal but complete statement of purpose.

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 database backup tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address critical context like permission requirements, performance impact, backup location, format, restoration procedures, or what happens if a backup with the same name exists. Given the potential complexity and risk of backup operations, more behavioral context 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 the single parameter 'name' documented as 'backup name'. The description doesn't add any parameter information beyond what the schema provides, but with complete schema coverage, the baseline is 3. The description doesn't explain naming conventions, constraints, or default behavior if no name is provided.

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 ('Create a backup') and the resource ('PocketBase database'), making the tool's purpose immediately understandable. It doesn't distinguish from sibling tools, but since backup operations are unique among the listed siblings, this is adequate. The description avoids tautology by specifying what kind of backup is created.

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, prerequisites, or timing considerations. While it's obvious this is for database backup, there's no mention of when backups should be created, what happens during backup, or whether other operations should be paused. This leaves the agent with insufficient context for optimal tool selection.

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