@@ -282,10 +282,9 @@ func NewMCPServer(config *Config) *server.MCPServer {
mcp.Min(0),
mcp.Max(720), // Aligned with CreateTaskRequest validation tag
),
- mcp.WithNumber("priority",
- mcp.Description("New task priority, -2 being lowest, 0 being normal, and 2 being highest."),
- mcp.Min(-2),
- mcp.Max(2),
+ mcp.WithString("priority",
+ mcp.Description("Task priority, omit unless priority is mentioned"),
+ mcp.Enum("lowest", "low", "neutral", "high", "highest"),
),
mcp.WithString("motivation",
mcp.Description("New motivation driving the task."),
@@ -611,14 +610,22 @@ func handleUpdateTask(
}
if priorityArg, exists := arguments["priority"]; exists && priorityArg != nil {
- if priorityVal, ok := priorityArg.(float64); ok {
- if priorityVal < -2 || priorityVal > 2 { // MCP tool range
- return reportMCPError("'priority' must be between -2 and 2 (inclusive).")
- }
- updatePayload.Priority = int(priorityVal)
- } else {
- return reportMCPError("Invalid type for priority argument: expected number.")
+ priorityStr, ok := priorityArg.(string)
+ if !ok {
+ return reportMCPError("Invalid type for 'priority' argument: expected string.")
+ }
+ priorityMap := map[string]int{
+ "lowest": -2,
+ "low": -1,
+ "neutral": 0,
+ "high": 1,
+ "highest": 2,
+ }
+ translatedPriority, isValid := priorityMap[strings.ToLower(priorityStr)]
+ if !isValid {
+ return reportMCPError(fmt.Sprintf("Invalid 'priority' value: '%s'. Must be one of 'lowest', 'low', 'neutral', 'high', 'highest'.", priorityStr))
}
+ updatePayload.Priority = translatedPriority
}
if motivationArg, exists := arguments["motivation"]; exists {