Skip to content

Commit 1930e51

Browse files
bingggclaude[bot]
andauthored
fix(functions): clarify cron expression requirements in trigger config (#134)
- Add explicit warning about 7-field requirement for timer triggers - Updated both createFunction and createFunctionTriggers tools - Prevents AI from using 6-field cron expressions that cause errors Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Booker Zhao <binggg@users.noreply.github.com>
1 parent fa10288 commit 1930e51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mcp/src/tools/functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function registerFunctionTools(server: ExtendedMcpServer) {
113113
triggers: z.array(z.object({
114114
name: z.string().describe("Trigger name"),
115115
type: z.enum(SUPPORTED_TRIGGER_TYPES).describe("Trigger type, currently only supports 'timer'"),
116-
config: z.string().describe("Trigger configuration. For timer triggers, use cron expression format: second minute hour day month week year. Examples: '0 0 2 1 * * *' (monthly), '0 30 9 * * * *' (daily at 9:30 AM)")
116+
config: z.string().describe("Trigger configuration. For timer triggers, use cron expression format: second minute hour day month week year. IMPORTANT: Must include exactly 7 fields (second minute hour day month week year). Examples: '0 0 2 1 * * *' (monthly), '0 30 9 * * * *' (daily at 9:30 AM)")
117117
})).optional().describe("Trigger configuration array"),
118118
handler: z.string().optional().describe("函数入口"),
119119
ignore: z.union([z.string(), z.array(z.string())]).optional().describe("忽略文件"),
@@ -455,7 +455,7 @@ export function registerFunctionTools(server: ExtendedMcpServer) {
455455
triggers: z.array(z.object({
456456
name: z.string().describe("Trigger name"),
457457
type: z.enum(SUPPORTED_TRIGGER_TYPES).describe("Trigger type, currently only supports 'timer'"),
458-
config: z.string().describe("Trigger configuration. For timer triggers, use cron expression format: second minute hour day month week year. Examples: '0 0 2 1 * * *' (monthly), '0 30 9 * * * *' (daily at 9:30 AM)")
458+
config: z.string().describe("Trigger configuration. For timer triggers, use cron expression format: second minute hour day month week year. IMPORTANT: Must include exactly 7 fields (second minute hour day month week year). Examples: '0 0 2 1 * * *' (monthly), '0 30 9 * * * *' (daily at 9:30 AM)")
459459
})).describe("Trigger configuration array")
460460
},
461461
annotations: {

0 commit comments

Comments
 (0)