bug: MCP ERROR (task-master-ai): SyntaxError: Unexpected token 'L', "Loaded cac"... is not valid JSON #163

Closed
opened 2025-10-14 15:44:18 -06:00 by navan · 0 comments
Owner

Originally created by @Astero81 on 8/18/2025

Description

When attempting to generate tasks from a Product Requirements Document (PRD) using the parse_prd tool within the
Gemini CLI, the process fails with a JSON parsing error. The tool appears to be receiving a non-JSON string
response (likely a log or status message) instead of the expected JSON output, which causes a SyntaxError. This
issue prevents the successful generation of project tasks from the PRD file. The error occurred after a previous
attempt to run the same command with the --research flag also failed, suggesting a potential issue with the
tool's output handling.

Steps to Reproduce

  1. Initialize a new project using the initialize_project tool (task-master init).
  2. Create a valid prd.txt file in the .taskmaster/docs/ directory.
  3. Execute the parse_prd tool, pointing to the created prd.txt file. For example:

1 default_api.parse_prd(input = "D:\Projects\taskmaster\.taskmaster\docs\prd.txt", numTasks = "0"
, projectRoot = "D:\Projects\taskmaster", research = False)
4. Observe the MCP error returned by the tool.

Expected Behavior

The parse_prd tool should successfully execute, parse the contents of the prd.txt file, and generate a
structured list of tasks in the corresponding tasks.json file without any errors.

Actual Behavior

The tool execution is aborted and returns an MCP error. The underlying cause is a SyntaxError because the tool
tries to parse a string that is not valid JSON. The invalid string begins with "Loaded cac...".

Screenshots or Logs

1 MCP ERROR (task-master-ai): SyntaxError: Unexpected token 'L', "Loaded cac"... is not valid JSON

Environment

  • Task Master version: 0.24.0
  • Node.js version: 24.3.0
  • Operating system: win11
  • IDE (if applicable): Gemini CLI

Additional Context

This error occurred on the second attempt to run the parse_prd command. The first attempt used the research=True
flag and failed with a different, more generic error ([Error: Could not parse tool response]). The subsequent
attempt with research=False produced this specific JSON parsing error. This may indicate an issue with how the
tool handles and returns data or errors across different execution paths.

*Originally created by @Astero81 on 8/18/2025* Description When attempting to generate tasks from a Product Requirements Document (PRD) using the parse_prd tool within the Gemini CLI, the process fails with a JSON parsing error. The tool appears to be receiving a non-JSON string response (likely a log or status message) instead of the expected JSON output, which causes a SyntaxError. This issue prevents the successful generation of project tasks from the PRD file. The error occurred after a previous attempt to run the same command with the --research flag also failed, suggesting a potential issue with the tool's output handling. Steps to Reproduce 1. Initialize a new project using the initialize_project tool (task-master init). 2. Create a valid prd.txt file in the .taskmaster/docs/ directory. 3. Execute the parse_prd tool, pointing to the created prd.txt file. For example: 1 default_api.parse_prd(input = "D:\\Projects\\taskmaster\\.taskmaster\\docs\\prd.txt", numTasks = "0" , projectRoot = "D:\\Projects\\taskmaster", research = False) 4. Observe the MCP error returned by the tool. Expected Behavior The parse_prd tool should successfully execute, parse the contents of the prd.txt file, and generate a structured list of tasks in the corresponding tasks.json file without any errors. Actual Behavior The tool execution is aborted and returns an MCP error. The underlying cause is a SyntaxError because the tool tries to parse a string that is not valid JSON. The invalid string begins with "Loaded cac...". Screenshots or Logs 1 MCP ERROR (task-master-ai): SyntaxError: Unexpected token 'L', "Loaded cac"... is not valid JSON Environment - Task Master version: 0.24.0 - Node.js version: 24.3.0 - Operating system: win11 - IDE (if applicable): Gemini CLI Additional Context This error occurred on the second attempt to run the parse_prd command. The first attempt used the research=True flag and failed with a different, more generic error ([Error: Could not parse tool response]). The subsequent attempt with research=False produced this specific JSON parsing error. This may indicate an issue with how the tool handles and returns data or errors across different execution paths.
Sign in to join this conversation.
No labels
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:installation
area:installation
area:installation
area:installation
area:installation
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
help wanted
help wanted
help wanted
help wanted
help wanted
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
integration request
integration request
integration request
integration request
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
low-priority
low-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
provider:anthropic
provider:anthropic
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:gemini-cli
provider:openai
provider:perplexity
question
question
question
question
question
question
question
question
question
question
question
question
question
question
refactor
refactor
wontfix
wontfix
wontfix
wontfix
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/claude-task-master#163
No description provided.