get_log
Retrieve a specific API request log from PocketBase by providing its unique ID.
Instructions
Get a single API request log by ID.
Input 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 main handler function for the 'get_log' tool. It validates the 'id' argument, calls pb.logs.getOne(id) to fetch a single log from PocketBase, and returns the result as JSON text.
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)The TypeScript interface defining the input arguments for the 'get_log' tool: a required 'id' field of type string.
export interface GetLogArgs { id: string; } - src/tools/log-tools.ts:24-34 (registration)Registration of the 'get_log' tool with its name, description, and input schema (requiring 'id'). This is part of the logToolInfo array returned by listLogTools().
{ 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)Routing logic in the main tool dispatcher: when the tool name is 'get_log', it delegates to handleLogToolCall().
} else if (name === 'list_logs' || name === 'get_log' || name === 'get_logs_stats') { return handleLogToolCall(name, toolArgs, pb); - src/tools/log-tools.ts:57-58 (registration)The switch case in handleLogToolCall() that routes 'get_log' to the getLog() function.
case 'get_log': return getLog(args as GetLogArgs, pb);