Skip to main content
Glama

create_trigger

Set up automation triggers for AI agents—webhook, database event, email, or schedule—with validation against Zihin's schema. Define configuration, sender access, and execution options in one call.

Instructions

Cria um novo trigger para um agente. Contrato autoritativo: resource zihin://schemas/trigger_config (o mesmo JSON Schema que o servidor valida; envie apenas agent_id/name/trigger_type/trigger_config — tenant_id e ids são injetados pelo servidor). Use SOMENTE os enums abaixo — não invente valores como "public" para sender_access.mode. A configuração (trigger_config) depende do tipo:

  • webhook: { query_extraction: { field: "chatInput" }, response_adapter: { format: "ebarn"|"slack"|"teams"|"twiml"|"raw" }, context_mapping: {}, session_strategy: { mode: "derive"|"ephemeral", fields?: [] }, sender_access?: { mode: "any"|"members"|"whitelist", identity_field?, match_column?, whitelist? }, execution?: { mode: "sync"|"async", ack_response?: { body, content_type }, callback?: { url, method, content_type, auth: { type, secret_ref }, body_template, response_transform }, message_buffer?: { enabled, window_ms, max_messages, concat_separator }, split_config?: { enabled, max_chunk_size, max_chunks, chunk_strategy: "paragraph"|"sentence"|"length", numbering, inter_chunk_delay_ms } } }

  • db_event: { table, events: ["INSERT","UPDATE"], conditions: {} }

  • email: { allowed_senders: [], subject_filter: "" }

  • schedule: { cron: "0 9 * * *", timezone: "America/Sao_Paulo", query_template: "mensagem fixa", enabled_days?: ["monday","friday"], session_strategy?: { mode: "new"|"persistent" }, output?: { channel: "webhook"|"silent"|"callback", webhook_url?: "https://..." (webhook), callback?: { url, method?, content_type?, auth?: { type, secret_ref }, body_template?, response_transform?: { strip_markdown, max_length } } (callback) } }

response_adapter.format determina defaults automáticos de transform: twiml → strip_markdown=true, max_length=4096. Override via execution.callback.response_transform. sender_access controla quem pode acionar o webhook: "any" (default), "members" (tenant_users), "whitelist" (lista explícita). message_buffer agrupa mensagens rápidas (popcorn) em uma janela de debounce via Redis antes de executar o agente. split_config divide respostas longas em múltiplos chunks para canais com limite de tamanho (WhatsApp, SMS).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNome do trigger
agent_idYesUUID do agente
api_key_idNoUUID da API Key para execução autenticada
descriptionNoDescrição do trigger
trigger_typeYesTipo de trigger
trigger_configNoConfiguração do trigger. Estrutura por tipo: WEBHOOK: { query_extraction: { mode: "field"|"full_body", field?: string (default: "message") }, response_adapter: { format: "ebarn"|"slack"|"teams"|"twiml"|"raw", content_type?: string, max_length?: number }, context_mapping?: { campo: "$.path.no.body" }, session_strategy?: { mode: "derive"|"ephemeral", fields?: string[] }, sender_access?: { mode: "any"|"members"|"whitelist", identity_field?: string, match_column?: string, whitelist?: string[] }, execution?: { mode: "sync"|"async", ack_response?: { body: string|object, content_type: string }, callback?: { url: string, method: "POST"|"PUT"|"PATCH", content_type: string, auth: { type: "basic"|"bearer"|"api_key"|"none", secret_ref: string }, headers?: object, body_template: object|string, response_transform?: { strip_markdown: boolean, max_length: number } }, message_buffer?: { enabled: boolean, window_ms?: number (100-60000, default 5000), max_messages?: number (1-100, default 10), concat_separator?: string (default "\n") }, split_config?: { enabled: boolean, max_chunk_size?: number (100-50000, default 1500), max_chunks?: number (1-50, default 10), chunk_strategy?: "paragraph"|"sentence"|"length" (default "paragraph"), numbering?: boolean (default true), inter_chunk_delay_ms?: number (0-10000, default 500) } } } SCHEDULE: { cron: string (ex: "0 9 * * *"), timezone?: string (default: "America/Sao_Paulo"), query_template: string (tarefa para o agente), enabled_days?: string[] (ex: ["monday","friday"]), session_strategy?: { mode: "new"|"persistent" }, output?: { channel: "webhook"|"silent"|"callback" (default: "silent"), webhook_url?: string (se channel=webhook), callback?: { url, method?, content_type?, auth?: { type, secret_ref }, body_template?, response_transform?: { strip_markdown?, max_length? } } (se channel=callback) }, memory_config?: { enabled: boolean, user_key_field?: string (campo do body_template, ex: "To"), strip_prefix?: string (ex: "whatsapp:"), ttl_hours?: number (default: 48), user_key?: string (fixo, alternativa a user_key_field) } } DB_EVENT: { table: string, events: ["INSERT"|"UPDATE"|"DELETE"], conditions?: object } EMAIL: { allowed_senders: string[], subject_filter?: string }
Install Server

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only indicate the tool is not read-only, not idempotent, and not destructive; the description adds substantial context: server-side ID injection, strict enum constraints, type-dependent configuration, automatic transform defaults (twiml → strip_markdown/max_length), sender_access semantics, message_buffer debounce, and split_config behavior. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and contract, but it becomes very long and largely reproduces the schema's trigger_config structure with examples. While the added semantics justify some length, several config snippets are redundant with the schema and could be trimmed.

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?

Covers purpose, authoritative contract, per-type config structures, enums, defaults, and key behavioral nuances—enough to make correct create_trigger calls. However, it explicitly says to send only four fields while the schema also exposes optional api_key_id and description, and it does not mention response/error behavior, leaving minor gaps.

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

Parameters5/5

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

Even with 100% schema coverage, the description adds meaning beyond the schema: it tells which parameters are actually expected, enumerates allowed enum values, and explains the effects and defaults of response_adapter.format, sender_access, message_buffer, and split_config. The authoritative contract reference resolves most ambiguity from the inline examples.

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 states a specific action ('Cria um novo trigger para um agente') with a clear resource (trigger for agent) and points to the authoritative contract. It is easily distinguished from sibling tools such as update_trigger, delete_trigger, and list_triggers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides strong usage guidance: send only agent_id/name/trigger_type/trigger_config because the server injects tenant_id and ids, and warns against inventing enum values. It does not explicitly name alternatives or state when to prefer this tool over update_trigger, so it stops short of a 5.

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

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/zihin-ai/zihin-mcp'

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