Skip to main content
Glama

maasy_trigger_workflow

Trigger a Maasy workflow manually to run automations, sequences, or CRM flows for a specific contact with custom variables.

Instructions

Trigger a maasy workflow manually — automations, sequences, CRM flows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoBrand UUID
workflow_idYesWorkflow UUID (get from maasy → Workflows)
contact_idNoContact UUID to run the workflow for
variablesNoCustom variables passed to the workflow

Implementation Reference

  • src/index.ts:341-351 (registration)
    Registration of the 'maasy_trigger_workflow' tool on the MCP server. It defines the schema (workflow_id, contact_id, variables) and delegates to toolHandler('trigger_workflow').
    server.tool(
      "maasy_trigger_workflow",
      "Trigger a maasy workflow manually — automations, sequences, CRM flows.",
      {
        project_id: z.string().optional().describe("Brand UUID"),
        workflow_id: z.string().describe("Workflow UUID (get from maasy → Workflows)"),
        contact_id: z.string().optional().describe("Contact UUID to run the workflow for"),
        variables: z.record(z.unknown()).optional().describe("Custom variables passed to the workflow"),
      },
      toolHandler("trigger_workflow")
    );
  • Generic toolHandler factory that wraps tool execution. For 'maasy_trigger_workflow', it calls callGateway('trigger_workflow', args) which sends the request to the Supabase mcp-gateway edge function.
    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,
          };
        }
      };
    }
  • Zod schema for the 'maasy_trigger_workflow' tool inputs: optional project_id, required workflow_id string, optional contact_id string, optional variables record.
    {
      project_id: z.string().optional().describe("Brand UUID"),
      workflow_id: z.string().describe("Workflow UUID (get from maasy → Workflows)"),
      contact_id: z.string().optional().describe("Contact UUID to run the workflow for"),
      variables: z.record(z.unknown()).optional().describe("Custom variables passed to the workflow"),
    },
  • The callGateway function that sends the tool name ('trigger_workflow') and arguments to the Supabase edge function (mcp-gateway) via HTTP POST.
    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?

With no annotations, the description carries the full burden of behavioral disclosure. It only says 'manually trigger' and lists workflow types, but does not explain side effects, whether execution is synchronous/asynchronous, any required permissions, or what happens after triggering. This is insufficient for a mutation-like action.

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 a single, front-loaded sentence with no wasted words. It is concise, though it could be slightly more informative without losing brevity. The structure is simple and readable.

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 4 parameters, one nested object, no output schema, and no annotations, the description is too sparse. It does not explain return values, asynchronous behavior, or operational context, leaving the agent without a full picture of the tool's behavior.

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%, with all four parameters described in the schema. The description adds no parameter-specific details beyond the schema, so it meets the baseline but does not improve comprehension.

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 triggers a maasy workflow manually, with a specific verb ('Trigger') and resource ('maasy workflow'). It mentions the workflow types (automations, sequences, CRM flows), providing some context. However, it does not explicitly distinguish it from sibling tools like maasy_execute_action, so it does not fully differentiate.

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. No mention of prerequisites, exclusions, or scenarios where other tools would be more appropriate. The description lacks any comparative or contextual usage hints.

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