Skip to main content
Glama
mrwyndham

PocketBase MCP Server

create_record

Add new records to PocketBase collections by specifying collection name and data fields for structured database entries.

Instructions

Create a new record in a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
dataYesRecord data

Implementation Reference

  • The main handler function that executes the create_record tool by calling PocketBase's create method on the specified collection with the provided data, returning the result as JSON text content.
    private async createRecord(args: any) {
      try {
        const result = await this.pb.collection(args.collection).create(args.data);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error: unknown) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to create record: ${pocketbaseErrorMessage(error)}`
        );
      }
    }
  • Defines the input schema for the create_record tool, requiring 'collection' (string) and 'data' (object).
    inputSchema: {
      type: 'object',
      properties: {
        collection: {
          type: 'string',
          description: 'Collection name',
        },
        data: {
          type: 'object',
          description: 'Record data',
        },
      },
      required: ['collection', 'data'],
    },
  • src/index.ts:202-219 (registration)
    Registers the create_record tool in the ListTools response, including name, description, and input schema.
    {
      name: 'create_record',
      description: 'Create a new record in a collection',
      inputSchema: {
        type: 'object',
        properties: {
          collection: {
            type: 'string',
            description: 'Collection name',
          },
          data: {
            type: 'object',
            description: 'Record data',
          },
        },
        required: ['collection', 'data'],
      },
    },
  • src/index.ts:675-676 (registration)
    Registers the handler for create_record in the CallToolRequestSchema switch statement.
    case 'create_record':
      return await this.createRecord(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. It states it creates a record, implying a write operation, but doesn't disclose behavioral traits like required permissions, whether it's idempotent, error handling, or what happens on success/failure. This is inadequate 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's appropriately sized and front-loaded with the core action, making it easy 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 with no annotations and no output schema, the description is incomplete. It lacks crucial context like what the tool returns, error conditions, or how it interacts with other tools (e.g., 'list_records' or 'delete_record'), leaving significant gaps for an agent.

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 already documents both parameters ('collection' and 'data'). The description doesn't add meaning beyond what the schema provides, such as examples or constraints, but the baseline is 3 when schema coverage is high.

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 verb ('Create') and resource ('new record in a collection'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'create_collection' or 'create_user', which also create resources but different 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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), when not to use it, or how it relates to siblings like 'create_collection' or 'update_record'.

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