Skip to main content
Glama

set_deployment_schedule

Configure automated execution timing for Prefect deployments using cron expressions or interval-based scheduling with timezone support.

Instructions

Set a deployment's schedule.

Args: deployment_id: The deployment UUID cron: Cron expression for the schedule interval_seconds: Alternative to cron - interval in seconds anchor_date: Required for interval schedules - the anchor date timezone: Timezone for the schedule

Returns: Updated schedule details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
anchor_dateNo
cronNo
deployment_idYes
interval_secondsNo
timezoneNo

Implementation Reference

  • The main handler function for the MCP tool 'set_deployment_schedule'. It is decorated with @mcp.tool for registration and implements the logic to set a Prefect deployment's schedule using either cron or interval-based scheduling via the Prefect client.
    @mcp.tool
    async def set_deployment_schedule(
        deployment_id: str,
        cron: Optional[str] = None,
        interval_seconds: Optional[int] = None,
        anchor_date: Optional[str] = None,
        timezone: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Set a deployment's schedule.
        
        Args:
            deployment_id: The deployment UUID
            cron: Cron expression for the schedule
            interval_seconds: Alternative to cron - interval in seconds
            anchor_date: Required for interval schedules - the anchor date
            timezone: Timezone for the schedule
            
        Returns:
            Updated schedule details
        """
        async with get_client() as client:
            # Check schedule type
            if cron is not None and interval_seconds is not None:
                return [types.TextContent(
                    type="text",
                    text="Cannot specify both cron and interval_seconds. Choose one schedule type."
                )]
            
            if cron is not None:
                # Set cron schedule
                schedule = await client.set_deployment_schedule(
                    deployment_id=UUID(deployment_id),
                    schedule={"cron": cron, "timezone": timezone}
                )
            elif interval_seconds is not None:
                # Set interval schedule
                if not anchor_date:
                    return [types.TextContent(
                        type="text",
                        text="anchor_date is required for interval schedules"
                    )]
                
                schedule = await client.set_deployment_schedule(
                    deployment_id=UUID(deployment_id),
                    schedule={
                        "interval": interval_seconds,
                        "anchor_date": anchor_date,
                        "timezone": timezone
                    }
                )
            else:
                return [types.TextContent(
                    type="text",
                    text="Must specify either cron or interval_seconds to set a schedule"
                )]
            
            return [types.TextContent(type="text", text=str(schedule.model_dump()))]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Set' implies a mutation operation, the description doesn't disclose whether this overwrites existing schedules, what permissions are required, whether the change is immediate or requires deployment restart, or what happens if invalid parameters are provided. The return statement mentions 'Updated schedule details' but provides no specifics about format or content.

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, args, returns) and uses bullet points effectively. While appropriately sized, the 'Args' section could be slightly more concise by combining related parameters (cron/interval_seconds as alternatives). Every sentence earns its place by adding value.

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?

For a mutation tool with 5 parameters, 0% schema coverage, no annotations, and no output schema, the description provides adequate basic information but has significant gaps. The parameter semantics are well-covered, but missing behavioral context (permissions, side effects, error conditions) and output details make this incomplete for confident tool invocation.

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

Parameters5/5

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

With 0% schema description coverage, the description provides essential semantic context for all 5 parameters that the schema lacks. It explains that 'cron' and 'interval_seconds' are alternatives, clarifies that 'anchor_date' is required for interval schedules, and provides meaningful context about each parameter's purpose. This fully compensates for the schema's lack of descriptions.

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

Purpose4/5

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

The description clearly states the verb ('Set') and resource ('a deployment's schedule'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'pause_deployment_schedule' or 'resume_deployment_schedule', which appear to be related schedule management 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 is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites (like needing an existing deployment), nor does it explain when to use cron versus interval scheduling. With sibling tools like 'get_deployment_schedule' and schedule pause/resume tools available, the lack of differentiation is a significant gap.

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/allen-munsch/mcp-prefect'

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