Skip to content

rust: report MCP upstream body-read failures as tool errors #980

Closed

Description

@athvin

Evidence

After receiving an HTTP response, the MCP bridge uses r.text().await.unwrap_or_default(). If the response body is truncated or otherwise unreadable, a successful status becomes empty text with isError: false, concealing the failed tool call. Source.

Change

Treat response-body read errors as tool errors and report a bounded, non-sensitive message. Keep HTTP status errors distinguishable from transport/body failures.

Done when

  • A local mock 200 response with a truncated body yields isError: true.
  • A complete 200 response still returns its body with isError: false.
  • Non-2xx and request transport errors retain their existing error behavior.

Activity

  1. added
    code-cleanup
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions