Skip to main content
Glama
fadlee

PocketBase MCP Server

by fadlee

create_user

Create a new user account in PocketBase by providing email, password, and verification settings to establish user authentication and access control.

Instructions

Create a new user account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
additionalDataNoAdditional user data fields specific to your auth collection
collectionNoAuth collection name (default: 'users')
emailYesUser email
emailVisibilityNoWhether the user email is publicly visible (default: false)
passwordYesUser password
passwordConfirmYesPassword confirmation (must match password)
verifiedNoWhether the user is verified (default: false)

Implementation Reference

  • Factory function that returns the async handler for the 'create_user' tool. It creates a new user in the specified PocketBase collection with email, password, confirmation, and optional fields.
    /**
     * Create a new user account
     */
    export function createCreateUserHandler(pb: PocketBase): ToolHandler {
      return async (args: CreateUserArgs) => {
        try {
          const collection = args.collection || "users";
          
          const userData: any = {
            email: args.email,
            password: args.password,
            passwordConfirm: args.passwordConfirm,
          };
          
          // Add optional fields
          if (args.verified !== undefined) userData.verified = args.verified;
          if (args.emailVisibility !== undefined) userData.emailVisibility = args.emailVisibility;
          
          // Add any additional data fields
          if (args.additionalData) {
            Object.assign(userData, args.additionalData);
          }
          
          const result = await pb.collection(collection).create(userData);
          
          return createJsonResponse(result);
        } catch (error: unknown) {
          throw handlePocketBaseError("create user", error);
        }
      };
    }
  • JSON Schema for input validation of the 'create_user' tool parameters.
    export const createUserSchema = {
      type: "object",
      properties: {
        collection: {
          type: "string",
          description: "Auth collection name (default: 'users')",
        },
        email: {
          type: "string",
          description: "User email",
        },
        password: {
          type: "string",
          description: "User password",
        },
        passwordConfirm: {
          type: "string",
          description: "Password confirmation (must match password)",
        },
        verified: {
          type: "boolean",
          description: "Whether the user is verified (default: false)",
        },
        emailVisibility: {
          type: "boolean",
          description: "Whether the user email is publicly visible (default: false)",
        },
        additionalData: {
          type: "object",
          description: "Additional user data fields specific to your auth collection",
        },
      },
      required: ["email", "password", "passwordConfirm"],
    };
  • src/server.ts:157-162 (registration)
    Tool registration in the MCP server array, linking the name 'create_user' to its schema and handler.
    {
      name: "create_user",
      description: "Create a new user account",
      inputSchema: createUserSchema,
      handler: createCreateUserHandler(pb),
    },
  • TypeScript interface defining the shape of arguments for the create_user handler.
    export interface CreateUserArgs {
      collection?: string;
      email: string;
      password: string;
      passwordConfirm: string;
      verified?: boolean;
      emailVisibility?: boolean;
      additionalData?: Record<string, any>;
    }
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. 'Create a new user account' implies a write/mutation operation, but the description doesn't mention authentication requirements, permissions, rate limits, whether the operation is idempotent, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 zero wasted words. It's appropriately sized and front-loaded with the core purpose. Every word earns its place, making it easy for an agent to parse quickly.

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 this is a mutation tool (creating users) with no annotations, no output schema, and 7 parameters, the description is incomplete. It doesn't address authentication needs, error conditions, return values, or how it fits within the broader system context (e.g., relationship to 'authenticate_user' or 'create_record'). The description alone leaves too many gaps for reliable tool invocation.

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%, so the schema fully documents all 7 parameters. The description adds no parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 'Create a new user account' clearly states the verb ('Create') and resource ('user account'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'create_record' or 'create_collection', which also create resources but different types. The description is specific but lacks sibling differentiation.

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's no mention of prerequisites, when not to use it, or how it differs from similar sibling tools like 'create_record' or 'authenticate_user'. The agent must infer usage from the tool name and parameters 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