aws / aws/amazon-q-developer-cli
bug: tool invocation fails after /load
- 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
### Operating system
GNU/Linux x86_64
### Expected behaviour
After using a tool and then using /save and /load to restore the state of the conversation, I can use the tool again.
### Actual behaviour
After using a tool and then using /save and /load to restore the state of the conversation, I can no longer use the tool.
### Steps to reproduce
# High-level idea
1. In a Q session, use a simple custom mcp tool, then `/save` the state of the conversation.
2. In another Q session, `/load` that state and use the same simple custom mcp tool again.
This seems to cause the error:
```txt
Tool validation failed:
The tool, "foobar___get_word_of_the_day" is supplied with incorrect name
```
# Example
## Simple MCP tool
In a simple MCP server `foobar` we have:
```python
@mcp.tool()
def get_word_of_the_day() -> str:
"""Takes no input and returns today's Word of the Day."""
return "The word of the day is: photography."
```
-----
## First Q session
```txt
🤖 You are chatting with claude-4-sonnet
> How much is 10 times 10?
10 times 10 equals 100.
> What is the word of the day?
🛠️ Using tool: get_word_of_the_day from mcp server foobar
⋮
● Running get_word_of_the_day with the param:
⋮ {
⋮ "arguments": {},
⋮ "name": "get_word_of_the_day"
⋮ }
Allow this action? Use 't' to trust (always allow) this tool for the session. [y/n/t]:
> t
⋮
● Completed in 0.3s
The word of the day is: photography.
> /save state_photography.json
✔ Exported conversation state to state_photography.json
> /quit
```
## Second Q session
```txt
🤖 You are chatting with claude-4-sonnet
> /load state_photography.json
✔ Imported conversation state from state_photography.json
> What is the word of the day?
Tool validation failed:
The tool, "foobar___get_word_of_the_day" is supplied with incorrect name
Let me try again with the correct tool name:
Tool validation failed:
The tool, "foobar___get_word_of_the_day" is supplied with incorrect name
```
Contributor guide
Assessment
This issue has not been assessed yet.