Skip to main content
Glama

maasy_execute_action

Execute marketing copilot actions: generate reports, redistribute budgets, rotate creatives, diagnose campaigns, and more using predefined actions.

Instructions

Execute a copilot action: generate report, redistribute budget, rotate creatives, diagnose campaigns, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoBrand UUID
actionYes

Implementation Reference

  • src/index.ts:279-296 (registration)
    Registration of the 'maasy_execute_action' tool via server.tool() with Zod schema for project_id and action enum (generate_weekly_report, redistribute_budget, rotate_creatives, recalculate_scores, send_followup_leads, diagnose_campaigns, fill_content_gap, check_email_health). Delegates to toolHandler('execute_action').
    server.tool(
      "maasy_execute_action",
      "Execute a copilot action: generate report, redistribute budget, rotate creatives, diagnose campaigns, etc.",
      {
        project_id: z.string().optional().describe("Brand UUID"),
        action: z.enum([
          "generate_weekly_report",
          "redistribute_budget",
          "rotate_creatives",
          "recalculate_scores",
          "send_followup_leads",
          "diagnose_campaigns",
          "fill_content_gap",
          "check_email_health",
        ]),
      },
      toolHandler("execute_action")
    );
  • Zod schema for maasy_execute_action: optional project_id (brand UUID string) and required action enum with 8 possible actions.
    server.tool(
      "maasy_execute_action",
      "Execute a copilot action: generate report, redistribute budget, rotate creatives, diagnose campaigns, etc.",
      {
        project_id: z.string().optional().describe("Brand UUID"),
        action: z.enum([
          "generate_weekly_report",
          "redistribute_budget",
          "rotate_creatives",
          "recalculate_scores",
          "send_followup_leads",
          "diagnose_campaigns",
          "fill_content_gap",
          "check_email_health",
        ]),
  • The toolHandler function wraps all tools. For 'execute_action', it calls callGateway('execute_action', args) which forwards to the Supabase edge function 'mcp-gateway' on the server side. The actual execution logic lives in the Supabase backend.
    function toolHandler(toolName: string, argsFn?: (args: Record<string, unknown>) => Record<string, unknown>) {
      return async (args: Record<string, unknown>) => {
        try {
          const gatewayArgs = argsFn ? argsFn(args) : args;
          // Auto-inject default project_id if not provided
          if (DEFAULT_PROJECT_ID && !gatewayArgs.project_id) {
            gatewayArgs.project_id = DEFAULT_PROJECT_ID;
          }
          const result = await callGateway(toolName, gatewayArgs);
          return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };
        } catch (e: unknown) {
          return {
            content: [{ type: "text" as const, text: `Error: ${e instanceof Error ? e.message : String(e)}` }],
            isError: true,
          };
        }
      };
    }
  • callGateway is the network helper that POSTs the tool name and args to the Supabase mcp-gateway edge function and returns the result. The actual 'execute_action' implementation is server-side in that edge function.
    export async function callGateway(tool: string, args: Record<string, unknown> = {}): Promise<unknown> {
      const res = await fetch(gatewayUrl, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          [authHeader.name]: authHeader.value,
        },
        body: JSON.stringify({ tool, args }),
      });
    
      const data = await res.json();
    
      if (!res.ok) {
        throw new Error(data.error || `Gateway error (${res.status})`);
      }
    
      return data.result;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

C2.9/5.0
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 of behavioral disclosure. It only says 'Execute,' without indicating side effects, reversibility, permissions, or what happens when the action runs. Since several actions (e.g., redistribute_budget, send_followup_leads) likely mutate state, this is a significant gap.

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, front-loaded sentence with concrete examples. Every word earns its place; 'etc.' is a reasonable placeholder for the remaining enum values. No redundancy or filler.

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?

A polymorphic executor with 8 possible actions and no output schema requires more context. The description does not explain what happens after execution (return values, success/failure), whether actions are reversible, or whether different actions have different requirements. Given the tool's complexity, the description is too thin.

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 50%: 'action' has an enum, which self-documents its values, and 'project_id' is described as 'Brand UUID.' The description adds examples of action values but does not explain the role of project_id or how it relates to execution. Overall, the schema carries the weight, with only marginal added meaning.

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 tool's function with a specific verb ('Execute') and resource ('copilot action'), and lists several concrete examples (generate report, redistribute budget, rotate creatives, diagnose campaigns). This differentiates it from the sibling tools, which are mostly getters/listers/generators. The trailing 'etc.' is acceptable, though it could have directly referenced the full enum.

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?

There is no guidance on when to use this tool versus alternatives. The description does not mention prerequisites, when it is preferred over other tools, or any exclusions. For example, it does not say whether to use this for one-off actions while other tools provide more focused operations.

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