aws / aws/amazon-q-developer-cli

MCP tool responses only display content field, ignoring structuredContent

Aperta
#2,865 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
MCP
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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

macOS

### Expected behaviour

When MCP tools return responses with both `content` and `structuredContent` fields, Amazon Q CLI should display both or at least the structured data from `structuredContent` field.

### Actual behaviour

Amazon Q CLI only displays the `content` field from MCP tool responses and completely ignores the `structuredContent` field, which often contains the actual useful data.

For example, an MCP tool response like:
```json
{
"content": [{"type": "text", "text": "User information retrieved"}],
"structuredContent": {
"authenticated": true,
"authMethod": "PAT",
"email": "user@example.com"
}
}
```

Only shows "User information retrieved" instead of the actual user data in `structuredContent`.

### Root Cause

In `crates/chat-cli/src/cli/chat/tools/custom_tool.rs`, the `CustomTool::invoke` method returns the raw MCP response as JSON, but the CLI only processes the `content` field and ignores `structuredContent`.

### Suggested Fix

Modify the MCP tool response processing to either:
1. Display both `content` and `structuredContent` fields
2. Prioritize `structuredContent` when available
3. Combine both fields in a meaningful way

### Steps to reproduce

1. Set up an MCP server that returns responses with both `content` and `structuredContent` fields
2. Call a tool that returns structured data
3. Observe that only the `content` field message is displayed
4. The actual structured data in `structuredContent` is not shown to the user

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in crates/chat-cli/src/cli/chat/tools/custom_tool.rs, in CustomTool::invoke, quindi segui il modo in cui la risposta MCP grezza viene elaborata per la visualizzazione. Riproduci la risposta di esempio che contiene sia content sia structuredContent e definisci done come la visualizzazione dei dati strutturati invece di ignorarli silenziosamente; la gestione scelta per entrambi i campi deve essere resa esplicita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.