diff --git a/main.go b/main.go index 64f3f728a288da96a53f6f3dd88d954506305d2b..5315d013438bf23648800d2af3a0828349b867ca 100644 --- a/main.go +++ b/main.go @@ -331,6 +331,7 @@ func handleCreateTask( if resp.StatusCode < 200 || resp.StatusCode >= 300 { respBody, _ := io.ReadAll(resp.Body) + log.Printf("Lunatask API error (status %d): %s", resp.StatusCode, string(respBody)) return &mcp.CallToolResult{ IsError: true, Content: []mcp.Content{mcp.TextContent{Type: "text", Text: fmt.Sprintf("API error (status %d): %s", resp.StatusCode, string(respBody))}}, @@ -353,7 +354,7 @@ func handleCreateTask( Content: []mcp.Content{ mcp.TextContent{ Type: "text", - Text: fmt.Sprint("Task created successfully.", response.Task.ID), + Text: fmt.Sprintf("Task created successfully with ID: %s", response.Task.ID), }, }, }, nil @@ -375,7 +376,7 @@ func createDefaultConfigFile(configPath string) { }}, }}, } - file, err := os.Create(configPath) + file, err := os.OpenFile(configPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600) if err != nil { log.Fatalf("Failed to create default config at %s: %v", configPath, err) }