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;
    }
Behavior2/5

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

Annotations are absent, so the description must convey behavioral traits. It fails to disclose side effects, permissions, idempotency, or error conditions for the various actions. For a mutation tool, this is insufficient.

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?

Single sentence with examples is efficient. Front-loads the verb. However, could benefit from bullet points or grouping of action categories for clarity.

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?

With no output schema or annotations, the description should explain return values, typical usage flow, or prerequisites for actions. It omits these, leaving an agent underinformed.

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

Parameters4/5

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

The description adds meaning to the 'action' enum by listing concrete examples (generate report, redistribute budget), which complements the schema where action has no description. 'project_id' is already explained as 'Brand UUID' in the schema.

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?

Description clearly states 'Execute a copilot action' with examples like generate report, rotate creatives, etc. This differentiates it from sibling CRUD tools (e.g., maasy_create_landing, maasy_generate_ads) but does not explicitly clarify nuance between executing an action via this tool versus calling a more specific generate tool.

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. For example, rotating creatives could be done via execute_action or a dedicated tool. The description does not provide criteria for selection or exclusion.

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/Jbelieve/mcp-server'

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