fix(routines): create_routine_trigger schema alinhado com API

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) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 04:31:31 +01:00
parent 281799fad2
commit 53ab2b99a6
+8 -4
View File
@@ -101,15 +101,19 @@ export const routineTools: PaperclipTool[] = [
}, },
{ {
name: 'create_routine_trigger', 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: { inputSchema: {
type: 'object', type: 'object',
properties: { properties: {
routine_id: { type: 'string', description: 'ID da rotina' }, routine_id: { type: 'string', description: 'ID da rotina' },
type: { type: 'string', description: 'Tipo de gatilho' }, kind: { type: 'string', description: 'schedule|webhook|api', enum: ['schedule', 'webhook', 'api'] },
config: { type: 'object', description: 'Configuracao do gatilho' }, 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) => { handler: async (args) => {
const { routine_id, ...body } = args as { routine_id: string; [k: string]: unknown }; const { routine_id, ...body } = args as { routine_id: string; [k: string]: unknown };