Skip to main content
Glama
mabeldata

PocketBase MCP Server

by mabeldata

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

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (defaults to 1).
perPageNoItems per page (defaults to 30, max 500).
filterNoPocketBase filter string (e.g., "method='GET'").
sortNoPocketBase sort string (e.g., "-created,url").

Implementation Reference

  • 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) }],
        };
    }
  • 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;
    }
  • 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: [],
            },
        },
  • 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);
  • Registration of log tools (including list_logs) via listLogTools() in the registerTools() function.
    ...listLogTools(), // Add log tools
    ...listCronTools(), // Add cron tools
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description lacks behavioral traits such as read-only nature or potential side effects, though listing logs is inherently non-destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, concise, and front-loaded with the action. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema; description does not specify return format (e.g., paginated logs, fields included). Adequate for a list endpoint but incomplete for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed parameter descriptions. The description only groups functionalities already present in the schema, adding no new semantic meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists API request logs with filtering, sorting, and pagination, distinguishing it from sibling tools like get_log and get_logs_stats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for listing logs with filtering/sorting/pagination but does not explicitly guide when to use this over other log tools or any prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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