Skip to main content
Glama
DynamicEndpoints

Advanced PocketBase MCP Server

get_collection

Retrieve collection details from PocketBase databases to access schema information and configure data structures for application development.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Direct implementation of get_collection tool handler: registers the tool with schema and executes pb.collections.getOne(nameOrId) to retrieve and return collection details as JSON.
    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) }] }; }
  • Direct implementation of get_collection tool handler in simple agent: registers with schema, ensures initialization, and fetches collection via pb.collections.getOne.
    '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}`); } }
  • Core handler logic for get_collection tool in worker-compatible agent: retrieves collection details using pb.collections.getOne and formats as MCP response.
    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}`); }
  • Dispatch/registration point in request handler switch statement that validates args and calls getCollection for get_collection tool.
    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); }
  • Input schema definition for get_collection tool in the list tools response.
    name: "get_collection", description: "Get detailed information about a specific collection", inputSchema: { type: "object", properties: { name: { type: "string", description: "Collection name" } }, required: ["name"] }

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

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