Skip to main content
Glama

generate_trigger_code

Generates Apps Script code to create automated triggers for Google Workspace, enabling scheduled or event-driven automation when direct API creation isn't possible.

Instructions

Generates Apps Script code for creating triggers.

The Apps Script API cannot create triggers directly - they must be created from within Apps Script itself. This tool generates the code you need.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trigger_typeYesType of trigger. One of: - "time_minutes" (run every N minutes: 1, 5, 10, 15, 30) - "time_hours" (run every N hours: 1, 2, 4, 6, 8, 12) - "time_daily" (run daily at a specific hour: 0-23) - "time_weekly" (run weekly on a specific day) - "on_open" (simple trigger - runs when document opens) - "on_edit" (simple trigger - runs when user edits) - "on_form_submit" (runs when form is submitted) - "on_change" (runs when content changes)
function_nameYesThe function to run when trigger fires (e.g., "sendDailyReport")
scheduleNoSchedule details (depends on trigger_type): - For time_minutes: "1", "5", "10", "15", or "30" - For time_hours: "1", "2", "4", "6", "8", or "12" - For time_daily: hour as "0"-"23" (e.g., "9" for 9am) - For time_weekly: "MONDAY", "TUESDAY", etc. - For simple triggers (on_open, on_edit): not needed

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that this tool generates code rather than performing the action directly, which is crucial behavioral context. However, it doesn't mention what happens to the generated code (e.g., whether it's returned as text, saved somewhere, or requires manual implementation), leaving gaps in understanding the tool's output behavior.

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 perfectly concise with only two sentences. The first sentence states the core purpose, and the second provides essential context about why this tool is needed. Every word earns its place with zero waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there's an output schema (though not shown here), the description doesn't need to explain return values. The description adequately explains the tool's purpose and context, though it could be more complete by mentioning what format the generated code takes or how it should be used after generation.

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?

The input schema has 100% description coverage, providing detailed documentation for all three parameters. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Generates Apps Script code') and resource ('for creating triggers'), distinguishing it from sibling tools that perform direct operations. It explicitly mentions the limitation that 'Apps Script API cannot create triggers directly', which further clarifies its unique purpose.

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 guidance on when to use this tool: when triggers must be created from within Apps Script itself, as the API cannot create them directly. It implicitly distinguishes this from sibling tools that directly manipulate resources, making it clear this is a code-generation tool rather than a direct trigger-creation tool.

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/HuntsDesk/ve-gws'

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