Skip to main content
Glama

create_trigger

Configures a new agent trigger for webhook, email, or schedule events, so you can define how incoming requests or timed tasks are processed.

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 } } }

  • 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" } (sessão nova a cada execução; é o único modo aceito para schedule), output?: { channel: "silent"|"webhook"|"callback"|"user" (user = SPEC D: entrega na sessão do chat nativo do usuário-alvo + push; exige target: { field: "user_id"|"consumer_key", value } e aceita push: { title, body }), 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

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" } (sessão nova a cada execução; é o único modo aceito para schedule), output?: { channel: "silent"|"webhook"|"callback"|"user" (default: "silent"; user = SPEC D: entrega na sessão do chat nativo + push, exige target: { field: "user_id"|"consumer_key", value }), 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 é REJEITADO pelo servidor (doc loop-review/38, onda 3): o resultado do schedule é entregue como MENSAGEM, use output.channel="user"|"callback"|"webhook" EMAIL: { allowed_senders: string[], subject_filter?: string }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.2.2
    • changedInput schema / properties / trigger_config / description
      Previous value: -"Configuração do trigger. Estrutura por tipo:\n\nWEBHOOK: { 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) } } }\n\nSCHEDULE: { 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) } }\n\nDB_EVENT: { table: string, events: [\"INSERT\"|\"UPDATE\"|\"DELETE\"], conditions?: object }\n\nEMAIL: { allowed_senders: string[], subject_filter?: string }"New value: +"Configuração do trigger. Estrutura por tipo:\n\nWEBHOOK: { 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) } } }\n\nSCHEDULE: { 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\" } (sessão nova a cada execução; é o único modo aceito para schedule), output?: { channel: \"silent\"|\"webhook\"|\"callback\"|\"user\" (default: \"silent\"; user = SPEC D: entrega na sessão do chat nativo + push, exige target: { field: \"user_id\"|\"consumer_key\", value }), 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 é REJEITADO pelo servidor (doc loop-review/38, onda 3): o resultado do schedule é entregue como MENSAGEM, use output.channel=\"user\"|\"callback\"|\"webhook\"\n\nEMAIL: { allowed_senders: string[], subject_filter?: string }"
    • changedInput schema / properties / trigger_type / enum
      Previous value: -[
      -  "webhook",
      -  "db_event",
      -  "email",
      -  "schedule"
      -]New value: +[
      +  "webhook",
      +  "email",
      +  "schedule"
      +]
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Beyond the annotations (readOnly=false, destructive=false, idempotent=false), the description discloses genuinely behavioral facts: server-side injection of tenant_id and ids, the authoritative validation contract at zihin://schemas/trigger_config, the default transforms derived from response_adapter.format, and that memory_config is rejected by the server for schedule triggers. This is exactly the extra context the annotations cannot carry.

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 purpose and validation contract are front-loaded, but the body is very long and largely duplicates the trigger_config JSON Schema already present in the input schema, including enum lists and defaults. It is dense and mostly single-paragraph, so structure could be improved and a good deal of the config recitation is redundant.

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?

For a complex, three-variant, nested-config creation tool with no output schema, the description covers type-dependent structures, enum restrictions, server-side injections, rejected fields, and default transformations. An agent has enough to call it correctly without further inference.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds semantics the schema does not: sender_access controls who can invoke the webhook ('any'/'members'/'whitelist'), message_buffer groups rapid messages via Redis debounce, and split_config chunks long responses for size-limited channels. It meaningfully enriches several nested parameters rather than merely restating them.

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 opening sentence 'Cria um novo trigger para um agente' states a specific verb and resource, and the rest of the text makes the creation semantics unambiguous. However, it never explicitly distinguishes itself from siblings like update_trigger, get_trigger, or test_trigger, so it falls short of a 5.

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

Usage Guidelines3/5

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

The description imposes real invocation constraints ('Use SOMENTE os enums abaixo', don't invent values, send only agent_id/name/trigger_type/trigger_config since tenant_id and ids are server-injected), which is useful guidance. It gives no explicit criteria for when to choose create_trigger over update_trigger or test_trigger, so it remains implied rather than explicit.

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