Skip to main content
Glama
mabeldata

PocketBase MCP Server

by mabeldata

list_cron_jobs

List all app-level cron jobs registered in your PocketBase application, with optional field selection to customize returned data.

Instructions

Returns list with all registered app level cron jobs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNoComma separated string of the fields to return in the JSON response (by default returns all fields). Ex.:?fields=*,expand.relField.name

Implementation Reference

  • The actual handler function that executes the 'list_cron_jobs' tool logic. It calls pb.crons.getFullList() with optional fields parameter and returns the result as JSON.
    async function listCronJobs(args: ListCronJobsArgs, pb: PocketBase): Promise<ToolResult> {
        const { fields } = args;
    
        try {
            const result = await pb.crons.getFullList({
                fields
            });
    
            return {
                content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
    
            };
        } catch (error) {
            // If there's an error, return a more descriptive error
            if (error instanceof Error) {
                return {
                    content: [{ type: 'text', text: `Error fetching cron list: ${error.message}` }],
                    isError: true
                };
            }
            throw error;
        }
    }
  • TypeScript interface for the input arguments of list_cron_jobs. Defines an optional 'fields' string property to filter returned fields.
    export interface ListCronJobsArgs {
      fields?: string;
    }
  • Tool info registration for list_cron_jobs including its name, description, and inputSchema. Exposed via listCronTools() function.
    const cronToolInfo: ToolInfo[] = [
        {
            name: 'list_cron_jobs',
            description: 'Returns list with all registered app level cron jobs.',
            inputSchema: {
                type: 'object',
                properties: {
                    fields: { type: 'string', description: 'Comma separated string of the fields to return in the JSON response (by default returns all fields). Ex.:?fields=*,expand.relField.name' }
                }
            }
        },
        {
            name: 'run_cron_job',
            description: 'Triggers a single cron job by its id.',
            inputSchema: {
                type: 'object',
                properties: {
                    jobId: { type: 'string', description: 'The identifier of the cron job to run.' }
                },
                required: ['jobId']
            }
        }
    ];
    
    export function listCronTools(): ToolInfo[] {
        return cronToolInfo;
    }
  • Routing in the central tool handler that dispatches 'list_cron_jobs' calls to handleCronToolCall().
    } else if (name === 'list_cron_jobs' || name === 'run_cron_job') {
        return handleCronToolCall(name, toolArgs, pb);
  • Dispatch function that routes the tool call name to the listCronJobs handler via a switch statement.
    export async function handleCronToolCall(name: string, args: any, pb: PocketBase): Promise<ToolResult> {
        switch (name) {
            case 'list_cron_jobs':
                return listCronJobs(args as ListCronJobsArgs, pb);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only mentions it returns a list, but does not disclose any behavioral traits like pagination, sorting, or permissions. Minimal disclosure beyond the basic function.

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?

The description is one sentence, 9 words, efficient and front-loaded. Every word contributes to the purpose with no unnecessary information.

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

Completeness4/5

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

For a simple list tool with one optional parameter and no output schema, the description is generally complete. Minor gaps exist, such as behavior when no cron jobs exist or default sort order, but these are not critical.

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 description coverage is 100% for the single parameter 'fields', which already explains its purpose. The tool description adds no additional meaning beyond what the schema provides, so baseline of 3 is appropriate.

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 it returns a list of app-level cron jobs, using a specific verb and resource. It distinguishes from siblings like 'run_cron_job' and other listing tools.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, such as 'run_cron_job' or other list tools. The description only states what it does without any context on when it is appropriate.

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