fix: return graceful response when AGENT_WALLET_SERVER is not configured - #40
Open
Rohiteswar wants to merge 2 commits into
Open
Conversation
added 2 commits
March 29, 2026 20:18
throwing when AGENT_WALLET_SERVER is not set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users setting up this MCP server for the first time are confused by
AGENT_WALLET_SERVERincluding 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_SERVERwas unset, callingsendTransactionorswapwould silently crash with a cryptic network error (fetch failedorTypeError: undefined/transactions/send) — giving users no indication of what went wrong or how to fix it.Changes
sendTransactionandswapnow return a graceful{ status,message }response whenAGENT_WALLET_SERVERis 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.AGENT_WALLET_SERVERis the base URL of a separately running HTTP server (e.g.http://localhost:3000),not an API key.Screenshots
AGENT_WALLET_SERVERwas 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.{ status, message }response. Claude can now surface this response through the tooling interface, providing clear and actionable feedback to the user or developer.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 buildpasses ✓