get_log
Retrieve a specific API request log by its unique ID to analyze request details and troubleshoot issues effectively using the PocketBase MCP Server.
Instructions
Get a single API request log by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the log to fetch. |
Implementation Reference
- src/tools/log-tools.ts:84-95 (handler)The handler function that implements the get_log tool logic: validates id, fetches the log using pb.logs.getOne(id), and returns JSON stringified result.async function getLog(args: GetLogArgs, pb: PocketBase): Promise<ToolResult> { if (!args.id) { throw invalidParamsError("Missing required argument: id"); } // Make the API request to get a single log const result = await pb.logs.getOne(args.id) return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
- src/types/tool-types.ts:83-85 (schema)Type definition for input arguments of get_log tool.export interface GetLogArgs { id: string; }
- src/tools/log-tools.ts:24-34 (registration)Tool registration info including name, description, and input schema for get_log.{ name: 'get_log', description: 'Get a single API request log by ID.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The ID of the log to fetch.' }, }, required: ['id'], }, },
- src/tools/index.ts:53-54 (registration)Dispatch/registration routing for get_log tool to the log tools handler.} else if (name === 'list_logs' || name === 'get_log' || name === 'get_logs_stats') { return handleLogToolCall(name, toolArgs, pb);
- src/tools/log-tools.ts:57-58 (helper)Helper switch case in handleLogToolCall that routes get_log to the getLog handler.case 'get_log': return getLog(args as GetLogArgs, pb);