list_collections
Retrieve a list of all collections in your PocketBase instance to view schema structure and manage data tables.
Instructions
List all collections in the PocketBase instance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/collection-tools.ts:61-67 (handler)The actual implementation of the list_collections tool: calls pb.collections.getFullList() and returns the result as JSON text.
async function listCollections(args: ListCollectionsArgs, pb: PocketBase): Promise<ToolResult> { // Args are ignored for this tool const result = await pb.collections.getFullList({ sort: '-created' }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/tools/collection-tools.ts:21-29 (schema)Input schema definition for list_collections: tool name, description, and an empty inputSchema (no arguments needed).
{ name: 'list_collections', description: 'List all collections in the PocketBase instance.', inputSchema: { type: 'object', properties: {}, // No arguments needed additionalProperties: false, }, }, - src/tools/collection-tools.ts:41-43 (handler)Routing logic inside handleCollectionToolCall that dispatches to listCollections for the 'list_collections' case.
case 'list_collections': // No args expected for list_collections, but pass anyway for consistency return listCollections(args as ListCollectionsArgs, pb); - src/tools/index.ts:45-48 (registration)Registration in the main tool router: routes 'list_collections' to handleCollectionToolCall.
if (name === 'fetch_record' || name === 'list_records' || name === 'create_record' || name === 'update_record') { return handleRecordToolCall(name, toolArgs, pb); } else if (name === 'get_collection_schema' || name === 'list_collections') { return handleCollectionToolCall(name, toolArgs, pb); - src/types/tool-types.ts:73-73 (schema)TypeScript type definition for ListCollectionsArgs, an empty interface (no arguments).
export interface ListCollectionsArgs {} // No arguments