From efdf9ebf88ad91de67399f26fd195bbcefcb5795 Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 29 Aug 2025 11:30:12 -0600 Subject: [PATCH] fix: resolve validation discrepancies between create_task and update_task - Standardize estimate max value to 720 minutes (12 hours) across both tools - Fix incorrect tool name references from get_task_timestamp to get_timestamp --- cmd/lunatask-mcp-server.go | 4 ++-- tools/tasks.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/lunatask-mcp-server.go b/cmd/lunatask-mcp-server.go index 5708029ca9e5f90c901f3c4155f76673b950412f..942a203469d259b60d5d5b4a0389aebeda696caf 100644 --- a/cmd/lunatask-mcp-server.go +++ b/cmd/lunatask-mcp-server.go @@ -229,9 +229,9 @@ func NewMCPServer(appConfig *Config) *server.MCPServer { mcp.Description("Additional details or notes for the task, using Markdown formatting. Include any extra context, requirements, or information provided by the user that doesn't fit in the task name."), ), mcp.WithNumber("estimate", - mcp.Description("Estimated completion time in minutes (0-1440, max 24 hours). Only include if user mentions a time estimate like '30 minutes' (pass 30) or '2 hours' (pass 120). Omit if no estimate is provided."), + mcp.Description("Estimated completion time in minutes (0-720, max 12 hours). Only include if user mentions a time estimate like '30 minutes' (pass 30) or '2 hours' (pass 120). Omit if no estimate is provided."), mcp.Min(0), - mcp.Max(1440), + mcp.Max(720), ), mcp.WithString("priority", mcp.Description("Task priority level. Valid values: 'lowest', 'low', 'neutral', 'high', 'highest'. Only include if user explicitly mentions priority or urgency. Omit for normal tasks."), diff --git a/tools/tasks.go b/tools/tasks.go index d199d0c028fcbaba444b48568a046e89ab21aff7..043c56d7da168e604c04709731770f12eba18092 100644 --- a/tools/tasks.go +++ b/tools/tasks.go @@ -101,7 +101,7 @@ func (h *Handlers) HandleCreateTask(ctx context.Context, request mcp.CallToolReq if scheduledOnArg, exists := arguments["scheduled_on"]; exists { if scheduledOnStr, ok := scheduledOnArg.(string); ok && scheduledOnStr != "" { if _, err := time.Parse(time.RFC3339, scheduledOnStr); err != nil { - return reportMCPError(fmt.Sprintf("Invalid format for scheduled_on: '%s'. Must be RFC3339 timestamp (e.g., YYYY-MM-DDTHH:MM:SSZ). Use get_task_timestamp tool first.", scheduledOnStr)) + return reportMCPError(fmt.Sprintf("Invalid format for scheduled_on: '%s'. Must be RFC3339 timestamp (e.g., YYYY-MM-DDTHH:MM:SSZ). Use get_timestamp tool first.", scheduledOnStr)) } } else if !ok { return reportMCPError("Invalid type for scheduled_on argument: expected string.") @@ -278,7 +278,7 @@ func (h *Handlers) HandleUpdateTask(ctx context.Context, request mcp.CallToolReq if scheduledOnStr, ok := scheduledOnArg.(string); ok { if scheduledOnStr != "" { if _, err := time.Parse(time.RFC3339, scheduledOnStr); err != nil { - return reportMCPError(fmt.Sprintf("Invalid format for scheduled_on: '%s'. Must be RFC3339. Use get_task_timestamp tool.", scheduledOnStr)) + return reportMCPError(fmt.Sprintf("Invalid format for scheduled_on: '%s'. Must be RFC3339. Use get_timestamp tool.", scheduledOnStr)) } } updatePayload.ScheduledOn = scheduledOnStr