Skip to main content
Glama
mabeldata

PocketBase MCP Server

by mabeldata

run_cron_job

Execute a specific cron job in your PocketBase database by providing its unique job identifier.

Instructions

Triggers a single cron job by its id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYesThe identifier of the cron job to run.

Implementation Reference

  • The actual implementation of the 'run_cron_job' tool. It takes a jobId argument, validates it, calls pb.crons.run(jobId) to trigger the cron job, and returns the result.
    async function runCronJob(args: RunCronJobArgs, pb: PocketBase): Promise<ToolResult> {
        if (!args.jobId) {
            throw invalidParamsError("Missing required argument: jobId");
        }
        
        // Make the API request to get a single log
        const result = await pb.crons.run(args.jobId)
        
        return {
            content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
    }
  • TypeScript interface defining the input arguments for the run_cron_job tool. It requires a 'jobId' string field.
    export interface RunCronJobArgs {
      jobId: string;
    }
  • Registration of the 'run_cron_job' tool in cronToolInfo array, defining its name, description, and inputSchema (requiring 'jobId').
        {
            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']
            }
        }
    ];
  • Routing logic that dispatches calls to 'run_cron_job' to handleCronToolCall.
    } else if (name === 'list_cron_jobs' || name === 'run_cron_job') {
        return handleCronToolCall(name, toolArgs, pb);
  • Dispatch inside handleCronToolCall that routes 'run_cron_job' to the runCronJob function.
            case 'run_cron_job':
                return runCronJob(args as RunCronJobArgs, pb);
            default:
                // This case should ideally not be reached due to routing in index.ts
                throw new Error(`Unknown cron tool: ${name}`);
    
        }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It only states that the tool 'triggers' the job, but fails to disclose whether the execution is asynchronous, what happens on success/failure, or any side effects. This lack of behavioral details is inadequate for safe invocation.

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 a single sentence of 8 words, containing no redundant information. Every word earns its place, making it highly concise and front-loaded with the core action.

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

Completeness2/5

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

Given the tool has one required parameter, no output schema, and no annotations, the description is incomplete. It fails to explain execution behavior (e.g., synchronous vs. asynchronous), return values, or error conditions, leaving significant gaps for an agent to safely use the tool.

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%, and the description merely paraphrases the input schema ('by its id'). It adds no additional meaning or context beyond what the parameter description already provides, so the 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 'Triggers a single cron job by its id' uses a specific verb ('triggers') and resource ('cron job'), clearly stating the action and distinguishing it from sibling tools like list_cron_jobs. The method ('by its id') aligns with the required parameter, making the purpose unambiguous.

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 lacks explicit guidance on when to use this tool versus alternatives (e.g., list_cron_jobs) or any preconditions. While the context of triggering a cron job is implied, no when-not or prerequisite information is provided, leaving the agent to infer usage.

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