Skip to main content
Glama
DynamicEndpoints

Advanced PocketBase MCP Server

list_collections

Retrieve and manage all collections in your PocketBase database using the Model Context Protocol for streamlined database operations and organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler function for the 'list_collections' tool that uses PocketBase's getFullList() to retrieve and return all collections as JSON.
    this.server.tool( "list_collections", "List all collections in the PocketBase database", {}, async () => { if (!this.pb) { throw new Error('PocketBase not initialized. Please configure POCKETBASE_URL.'); } const collections = await this.pb.collections.getFullList(); return { content: [{ type: 'text', text: JSON.stringify(collections, null, 2) }] }; } );
  • Private handler method for the 'list_collections' tool that uses PocketBase's getFullList() to retrieve and return all collections as JSON.
    private async listCollections() { if (!this.pb) { throw new Error('PocketBase not configured'); } try { const collections = await this.pb.collections.getFullList(); return { content: [ { type: "text", text: JSON.stringify(collections, null, 2) } ] }; } catch (error: any) { throw new Error(`Failed to list collections: ${error.message}`); } }
  • Switch case registration that dispatches 'list_collections' tool calls to the listCollections() handler.
    case "list_collections": return await this.listCollections();
  • Tool schema definition for 'list_collections' including name, description, and empty input schema (no parameters required).
    name: "list_collections", description: "List all PocketBase collections", inputSchema: { type: "object", properties: {}, required: [] } },
  • Direct tool registration using server.tool() with inline handler for 'list_collections'.
    this.server.tool( "list_collections", "List all collections in the PocketBase database", {}, async () => { if (!this.pb) { throw new Error('PocketBase not initialized. Please configure POCKETBASE_URL.'); } const collections = await this.pb.collections.getFullList(); return { content: [{ type: 'text', text: JSON.stringify(collections, null, 2) }] }; } );

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

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