Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Generate Trigger Code

generate_trigger_code
Read-onlyIdempotent

Generate Apps Script code to create time-driven or event-based triggers, enabling automated function execution in Google Workspace.

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. To list or remove existing triggers without opening the editor, use manage_script_trigger (action="list" / action="delete") instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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
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")

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already indicate readOnly and idempotent behavior. The description adds crucial context beyond those hints: this tool does not create triggers directly, it only generates the code the user must run inside Apps Script. This effectively communicates that calling the tool has no trigger-creation side effect.

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 compact and front-loaded with the core purpose. The API limitation and sibling routing each earn their place without redundancy or filler.

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

Completeness5/5

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

The description covers the tool's purpose, its API constraint, the generation behavior, and the appropriate sibling for list/delete operations. With detailed schema coverage and a present output schema, nothing essential is missing for an agent to invoke it correctly.

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% parameter description coverage, including allowed values for trigger_type and schedule semantics. The description itself does not add parameter-level meaning beyond what the schema already provides, so the baseline score applies.

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?

States a specific verb and resource: 'Generates Apps Script code for creating triggers.' This clearly distinguishes the tool from direct trigger management and from manage_script_trigger, which is called out by name.

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?

Explicitly explains the constraint that triggers cannot be created via the Apps Script API and must be created from within Apps Script itself. It then names the sibling alternative for listing/removing triggers, giving clear when-to-use versus when-not-to-use guidance.

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

Deploy Server

Other Tools