list_logs
Retrieve and filter API request logs from PocketBase with pagination, sorting, and custom filter strings.
Instructions
List API request logs from PocketBase with filtering, sorting, and pagination.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (defaults to 1). | |
| perPage | No | Items per page (defaults to 30, max 500). | |
| filter | No | PocketBase filter string (e.g., "method='GET'"). | |
| sort | No | PocketBase sort string (e.g., "-created,url"). |
Implementation Reference
- src/tools/log-tools.ts:69-82 (handler)The main implementation of the list_logs tool. Calls pb.logs.getList() with optional page, perPage, filter, and sort parameters, returning the result as JSON.
async function listLogs(args: ListLogsArgs, pb: PocketBase): Promise<ToolResult> { const { page = 1, perPage = 30, filter, sort } = args; // Make the API request to list logs const result = await pb.logs.getList( page, perPage, { filter }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } - src/types/tool-types.ts:76-81 (schema)TypeScript interface defining the input arguments for list_logs: optional page, perPage, filter, and sort.
export interface ListLogsArgs { page?: number; perPage?: number; filter?: string; sort?: string; } - src/tools/log-tools.ts:9-23 (registration)Registration metadata for the list_logs tool: name, description, and inputSchema with optional properties page, perPage, filter, sort.
const logToolInfo: ToolInfo[] = [ { name: 'list_logs', description: 'List API request logs from PocketBase with filtering, sorting, and pagination.', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (defaults to 1).', minimum: 1 }, perPage: { type: 'number', description: 'Items per page (defaults to 30, max 500).', minimum: 1, maximum: 500 }, filter: { type: 'string', description: 'PocketBase filter string (e.g., "method=\'GET\'").' }, sort: { type: 'string', description: 'PocketBase sort string (e.g., "-created,url").' } }, required: [], }, }, - src/tools/index.ts:53-54 (registration)Routing logic in handleToolCall that dispatches 'list_logs' to handleLogToolCall.
} else if (name === 'list_logs' || name === 'get_log' || name === 'get_logs_stats') { return handleLogToolCall(name, toolArgs, pb); - src/tools/index.ts:21-22 (registration)Registration of log tools (including list_logs) via listLogTools() in the registerTools() function.
...listLogTools(), // Add log tools ...listCronTools(), // Add cron tools