list_migrations
Identify and display all migration files in the PocketBase migrations directory, enabling users to track and manage database schema updates efficiently using the MCP server.
Instructions
List all migration files found in the PocketBase migrations directory.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/migration-tools.ts:251-259 (handler)The handler function that executes the list_migrations tool, calling listMigrations() and formatting the result.async function handleListMigrations(args: ListMigrationsArgs): Promise<ToolResult> { const files = await listMigrations(); if (files.length === 0) { return { content: [{ type: 'text', text: 'No migration files found.' }] }; } return { content: [{ type: 'text', text: `Found migration files:\n${files.join('\n')}` }], }; }
- src/tools/migration-tools.ts:32-32 (schema)Type definition for the input arguments of list_migrations (no arguments required).interface ListMigrationsArgs {} // No arguments
- src/tools/migration-tools.ts:114-121 (registration)Tool registration including name, description, and input schema.name: 'list_migrations', description: 'List all migration files found in the PocketBase migrations directory.', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, },
- src/tools/index.ts:15-25 (registration)Top-level tool registration including migration tools.export function registerTools(): { tools: ToolInfo[] } { // Use ToolInfo[] const tools: ToolInfo[] = [ // Use ToolInfo[] ...listRecordTools(), ...listCollectionTools(), ...listFileTools(), ...listMigrationTools(), // Uncommented ...listLogTools(), // Add log tools ...listCronTools(), // Add cron tools ]; return { tools }; }
- src/migrations/index.ts:119-121 (helper)Helper function that lists migration files, called by the handler.export async function listMigrations(): Promise<string[]> { return helpers.listMigrationFiles(); }