aws / aws/amazon-q-developer-cli

MCP tool responses only display content field, ignoring structuredContent

Offen
#2,865 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
MCP
Vorherrschende Sprache
Rust
Sterne
2k
Forks
439
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in crates/chat-cli/src/cli/chat/tools/custom_tool.rs bei CustomTool::invoke und verfolge anschließend, wie die rohe MCP-Antwort für die Anzeige verarbeitet wird. Reproduziere die Beispielantwort, die sowohl content als auch structuredContent enthält, und definiere done so, dass die strukturierten Daten angezeigt werden, anstatt sie stillschweigend zu ignorieren; die gewählte Behandlung beider Felder muss explizit gemacht werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.