aws / aws/amazon-q-developer-cli

fs_write tool fails with "No such file or directory" error when trying to modify MCP configuration

Open
#1,441 1 comment 2 reactions 0 assignees View on GitHub
MCP
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 15.3.2 (24D81)

### Expected behaviour

The fs_write tool should be able to modify the MCP configuration file to fix JSON syntax errors like trailing commas.

### Actual behaviour

When attempting to use the fs_write tool to fix a trailing comma in the MCP configuration file (~/.aws/amazonq/mcp.json), the tool fails with the following error:

"Amazon Q is having trouble responding right now:
0: failed to print tool, `fs_write`: No such file or directory (os error 2)

Location:
/private/tmp/788abf33-519d-4264-918b-e563eeb425ff/crates/q_chat/src/lib.rs:1019"

```

Chat history

````
I'll help you fix the trailing comma error in your MCP configuration file. Let's examine the file and fix the issue at line 74, column 3.

🛠️ Using tool: fs_read (trusted)

● Reading file: ~/.aws/amazonq/mcp.json, all lines

● Completed in 0.0s

```

### Steps to reproduce

1. Identify a JSON syntax error in ~/.aws/amazonq/mcp.json (trailing comma at line 74, column 3)
2. Use fs_read to examine the file contents
3. Attempt to use fs_write to fix the trailing comma by replacing the problematic section
4. Observe the "No such file or directory" error

### Environment

```yaml
[q-details]
version = "1.9.1"
hash = "5d2c2807cab9bc6c9dc5fcd05f92c7a979e8a4f7"
date = "2025-04-29T06:22:42.917989Z (1d ago)"
variant = "full"

[system-info]
os = "macOS 15.3.2 (24D81)"
chip = "Apple M1 Pro"
total-cores = 10
memory = "32.00 GB"

[environment]
os = "Mac"
shell-path = "/bin/zsh"
shell-version = "5.9"
terminal = "VSCode"
install-method = "unknown"

[env-vars]
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.9.1"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
ZDOTDIR = "/Users/USER"
__CFBundleIdentifier = "com.microsoft.VSCode"

[chat-settings]
interactive=true

[chat-trusted_tools]

[chat-failed_request_ids]
none

[chat-context]
current_profile=default
profiles=
default

global_context=
.amazonq/rules/**/*.md
README.md
AmazonQ.md

profile_context=none

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.