Skip to main content
Glama
mabeldata

PocketBase MCP Server

by mabeldata

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
NameRequiredDescriptionDefault
idYesThe ID of the log to fetch.

Implementation Reference

  • 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) }],
        };
    }
  • Type definition for input arguments of get_log tool.
    export interface GetLogArgs {
      id: string;
    }
  • 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'],
        },
    },
  • 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);
  • Helper switch case in handleLogToolCall that routes get_log to the getLog handler.
    case 'get_log':
        return getLog(args as GetLogArgs, 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/mabeldata/pocketbase-mcp'

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