Skip to main content
Glama

deploy_cloudflare_worker

Deploy Cloudflare Workers with state tracking and health checks for reliable infrastructure orchestration.

Instructions

Deploy Cloudflare Worker with state tracking and health checks. DO NOT use ssh_exec('wrangler deploy') - always use this tool instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
worker_nameYesWorker name (e.g., 'voicenotes-webhook')
source_dirNoSource directory containing wrangler.toml
envNoEnvironment (production/staging, default: production)

Implementation Reference

  • Handler logic for the 'deploy_cloudflare_worker' tool. Destructures arguments and calls the executeOrchestrator helper with operation 'deploy/cloudflare-worker' and resolved parameters.
    case "deploy_cloudflare_worker": {
      const { worker_name, source_dir, env } = args as {
        worker_name: string;
        source_dir?: string;
        env?: string;
      };
      
      result = executeOrchestrator("deploy/cloudflare-worker", {
        worker_name,
        source_dir: source_dir || `/Users/customer/${worker_name}`,
        env: env || "production"
      });
      break;
    }
  • Input schema defining the parameters for the 'deploy_cloudflare_worker' tool, including worker_name (required), source_dir, and env.
    inputSchema: {
      type: "object",
      properties: {
        worker_name: {
          type: "string",
          description: "Worker name (e.g., 'voicenotes-webhook')"
        },
        source_dir: {
          type: "string",
          description: "Source directory containing wrangler.toml"
        },
        env: {
          type: "string",
          description: "Environment (production/staging, default: production)"
        }
      },
      required: ["worker_name"]
    }
  • src/index.ts:69-90 (registration)
    Registration of the 'deploy_cloudflare_worker' tool in the tools array, including name, description, and input schema.
    {
      name: "deploy_cloudflare_worker",
      description: "Deploy Cloudflare Worker with state tracking and health checks. DO NOT use ssh_exec('wrangler deploy') - always use this tool instead.",
      inputSchema: {
        type: "object",
        properties: {
          worker_name: {
            type: "string",
            description: "Worker name (e.g., 'voicenotes-webhook')"
          },
          source_dir: {
            type: "string",
            description: "Source directory containing wrangler.toml"
          },
          env: {
            type: "string",
            description: "Environment (production/staging, default: production)"
          }
        },
        required: ["worker_name"]
      }
    },
  • Shared helper function executeOrchestrator that runs python orchestrator.py with the specified operation and parameters, used by all tools including deploy_cloudflare_worker.
    function executeOrchestrator(operation: string, params: Record<string, string> = {}): any {
      const paramStr = Object.entries(params)
        .map(([key, value]) => `${key}="${value}"`)
        .join(" ");
      
      const cmd = `cd ${ORCHESTRATOR_PATH} && python orchestrator.py ${operation} ${paramStr}`;
      
      try {
        const output = execSync(cmd, {
          encoding: "utf-8",
          maxBuffer: 10 * 1024 * 1024
        });
        
        // Try to parse as JSON, fallback to plain text
        try {
          return JSON.parse(output);
        } catch {
          return { output: output.trim() };
        }
      } catch (error: any) {
        return {
          success: false,
          error: error.message,
          stderr: error.stderr?.toString() || "",
          stdout: error.stdout?.toString() || ""
        };
      }
    }
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. It mentions 'state tracking and health checks,' which adds some context beyond the basic deployment action, but lacks details on permissions, rate limits, error handling, or what 'state tracking' entails, leaving significant gaps for a mutation tool.

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 front-loaded with the core purpose and includes a critical usage guideline in just two sentences, with zero wasted words, making it highly efficient and well-structured.

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?

Given the complexity of a deployment tool with no annotations and no output schema, the description is minimally adequate. It covers the purpose and usage but lacks details on behavioral aspects like error handling or return values, leaving room for improvement in completeness.

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%, so the schema already documents all three parameters thoroughly. The description does not add any additional meaning or context about the parameters beyond what the schema provides, resulting in the baseline score.

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 action ('Deploy Cloudflare Worker') and resource ('Cloudflare Worker'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'deploy_mcp_server' beyond the specific resource type, which keeps it from a perfect score.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance by stating 'DO NOT use ssh_exec('wrangler deploy') - always use this tool instead,' which clearly indicates when to use this tool versus an alternative method, though it doesn't compare to sibling tools directly.

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/itsablabla/lastrock-mcp'

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