Skip to content

fix: return graceful response when AGENT_WALLET_SERVER is not configured - #40

Open
Rohiteswar wants to merge 2 commits into
alchemyplatform:mainfrom
Rohiteswar:fix/agent-wallet-server-missing-config-error
Open

fix: return graceful response when AGENT_WALLET_SERVER is not configured#40
Rohiteswar wants to merge 2 commits into
alchemyplatform:mainfrom
Rohiteswar:fix/agent-wallet-server-missing-config-error

Conversation

@Rohiteswar

Copy link
Copy Markdown

Problem

Users setting up this MCP server for the first time are confused by AGENT_WALLET_SERVER including myself. The README described it as a URL but wasn't clear it's a separate server you run yourself, not an API key or an Alchemy-provided value.

When AGENT_WALLET_SERVER was unset, calling sendTransaction or swap would silently crash with a cryptic network error (fetch failed or TypeError: undefined/transactions/send) — giving users no indication of what went wrong or how to fix it.

Changes

  • sendTransaction and swap now return a graceful { status,message } response when AGENT_WALLET_SERVER is not set, instead of network call crashing. The MCP server keeps running and Claude can relay the message clearly to the user or the dev.
  • Clarified the README to explain that AGENT_WALLET_SERVER is the base URL of a separately running HTTP server (e.g.http://localhost:3000),not an API key.
  • Added before-and-after screenshots showcasing the improved error handling, replacing unclear network failures with structured { status, message } response.

Screenshots

  • Before: When AGENT_WALLET_SERVER was not configured, the MCP server did not handle the request gracefully, resulting in no meaningful response being returned to Claude, which made the issue unclear to the user.
image
  • After: With the updated error handling, the MCP server actively returns a structured { status, message } response. Claude can now surface this response through the tooling interface, providing clear and actionable feedback to the user or developer.
image

Why graceful response over throw?

A hard throw would surface as a red error in the agent. Returning a structured response lets Claude read it and explain the situation naturally to the user — better UX with no server interruption.

Testing

pnpm build passes ✓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant