get_collection_schema
Retrieve schema details for a specific PocketBase collection to understand its structure, fields, and data types.
Instructions
Get schema details for a collection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection | Yes | Collection name |
Implementation Reference
- src/tools/handlers/collection.ts:42-51 (handler)Creates the ToolHandler for get_collection_schema, which retrieves the full schema details of a specified PocketBase collection using pb.collections.getOne.export function createGetCollectionSchemaHandler(pb: PocketBase): ToolHandler { return async (args: { collection: string }) => { try { const result = await pb.collections.getOne(args.collection); return createJsonResponse(result); } catch (error: unknown) { throw handlePocketBaseError("get collection schema", error); } }; }
- JSON Schema defining the input for get_collection_schema tool: requires a 'collection' string parameter.export const getCollectionSchemaSchema = { type: "object", properties: { collection: { type: "string", description: "Collection name", }, }, required: ["collection"], };
- src/server.ts:106-110 (registration)Registers the get_collection_schema tool in the MCP server's tools array, associating its name, description, input schema, and handler.name: "get_collection_schema", description: "Get schema details for a collection", inputSchema: getCollectionSchemaSchema, handler: createGetCollectionSchemaHandler(pb), },