Skip to main content
Glama
DynamicEndpoints

pocketbase-mcp-server

get_collection

Retrieve detailed information about a specific collection in a PocketBase database using the Model Context Protocol (MCP). Simplify database schema understanding and management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that executes the get_collection tool logic by fetching collection details from PocketBase using pb.collections.getOne(name)
    private async getCollection(name: string) {
      if (!this.pb) {
        throw new Error('PocketBase not configured');
      }
    
      try {
        const collection = await this.pb.collections.getOne(name);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(collection, null, 2)
            }
          ]
        };
      } catch (error: any) {
        throw new Error(`Failed to get collection: ${error.message}`);
      }
    }
  • Tool dispatch/registration in the central switch statement for handling get_collection calls
    case "get_collection": {
      if (!args || typeof args !== "object" || typeof (args as any).name !== "string") {
        throw new Error("'name' is required and must be a string for get_collection");
      }
      return await this.getCollection((args as any).name);
    }
  • Direct tool registration and inline handler for get_collection in Cloudflare agent implementation
    this.server.tool(
      "get_collection",
      "Get details of a specific collection",
      { nameOrId: z.string().describe('Collection name or ID') },
      async ({ nameOrId }) => {
        if (!this.pb) {
          throw new Error('PocketBase not initialized');
        }
    
        const collection = await this.pb.collections.getOne(nameOrId);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(collection, null, 2)
          }]
        };
      }
    );
  • Tool registration and inline handler for get_collection in simple agent implementation
    this.server.tool(
      'get_collection',
      {
        description: 'Get details of a specific collection',
        inputSchema: {
          nameOrId: z.string().describe('Collection name or ID')
        }
      },
      async ({ nameOrId }) => {
        await this.ensureInitialized();
        if (!this.pb) {
          throw new Error('PocketBase not initialized');
        }
    
        try {
          const collection = await this.pb.collections.getOne(nameOrId);
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(collection, null, 2)
            }]
          };
        } catch (error: any) {
          throw new Error(`Failed to get collection: ${error.message}`);
        }
      }
    );
  • Input schema definition for get_collection tool in worker entry point tools list
      name: 'get_collection',
      description: 'Get details of a specific collection',
      inputSchema: {
        type: 'object',
        properties: {
          nameOrId: { type: 'string', description: 'Collection name or ID' }
        },
        required: ['nameOrId']
      }
    },
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

Related 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/DynamicEndpoints/pocketbase-mcp-server'

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