From 53ab2b99a6c3170ced440cbcba70868a1c5d7843 Mon Sep 17 00:00:00 2001 From: Emanuel Almeida Date: Tue, 7 Apr 2026 04:31:31 +0100 Subject: [PATCH] fix(routines): create_routine_trigger schema alinhado com API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API exige cronExpression/timezone (não schedule.cron). Schema do MCP agora reflecte os campos reais e tem kind como discriminator obrigatório. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/tools/routines.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tools/routines.ts b/src/tools/routines.ts index a791a49..eb4d10b 100644 --- a/src/tools/routines.ts +++ b/src/tools/routines.ts @@ -101,15 +101,19 @@ export const routineTools: PaperclipTool[] = [ }, { name: 'create_routine_trigger', - description: 'Criar um gatilho para uma rotina', + description: 'Criar um gatilho para uma rotina. Para schedule passar kind="schedule" + schedule={cron,tz} + enabled + label.', inputSchema: { type: 'object', properties: { routine_id: { type: 'string', description: 'ID da rotina' }, - type: { type: 'string', description: 'Tipo de gatilho' }, - config: { type: 'object', description: 'Configuracao do gatilho' }, + kind: { type: 'string', description: 'schedule|webhook|api', enum: ['schedule', 'webhook', 'api'] }, + cronExpression: { type: 'string', description: 'Para kind=schedule: cron 5-field (ex: "0 9 * * 1")' }, + timezone: { type: 'string', description: 'Para kind=schedule: ex Europe/Lisbon' }, + webhookSecret: { type: 'string', description: 'Para kind=webhook' }, + enabled: { type: 'boolean', description: 'Estado activo (default true)' }, + label: { type: 'string', description: 'Label legivel' }, }, - required: ['routine_id'], + required: ['routine_id', 'kind'], }, handler: async (args) => { const { routine_id, ...body } = args as { routine_id: string; [k: string]: unknown };