Skip to main content
Glama
fadlee

PocketBase MCP Server

by fadlee

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
NameRequiredDescriptionDefault
collectionYesCollection name

Implementation Reference

  • 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), },

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

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