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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/agent-cloudflare.ts:313-330 (handler)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) }] }; } );
- src/agent-worker-compatible.ts:319-337 (handler)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}`); } }
- src/agent-worker-compatible.ts:119-121 (registration)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: [] } },
- src/agent-cloudflare.ts:313-330 (registration)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) }] }; } );