From f92a40f42880908709f8db02c526d30f3776d1f2 Mon Sep 17 00:00:00 2001 From: JP Date: Wed, 25 Feb 2026 23:19:38 +1100 Subject: [PATCH] chore: rename find_token to search_token Align MCP tool name with the action type used by agent-backend and the frontend tool handler. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- internal/skills/files/evm-token-transfer.md | 2 +- internal/skills/files/spark-savings.md | 2 +- internal/tools/{find_token.go => search_token.go} | 6 +++--- internal/tools/tools.go | 2 +- internal/types/tokenresult.go | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) rename internal/tools/{find_token.go => search_token.go} (96%) diff --git a/CLAUDE.md b/CLAUDE.md index 51e4952..cfe1901 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -39,7 +39,7 @@ internal/tools/ get_address.go # Derive address for any supported chain get_eth_balance.go # Query native ETH balance get_token_balance.go # Query ERC-20 token balance - find_token.go # Token discovery via CoinGecko API + search_token.go # Token discovery via CoinGecko API internal/coingecko/client.go # CoinGecko REST API client internal/blockchair/client.go # Blockchair UTXO chain API client (via Vultisig proxy) internal/tools/ diff --git a/internal/skills/files/evm-token-transfer.md b/internal/skills/files/evm-token-transfer.md index 1c687a5..13d98be 100644 --- a/internal/skills/files/evm-token-transfer.md +++ b/internal/skills/files/evm-token-transfer.md @@ -21,7 +21,7 @@ Build an unsigned ERC-20 token transfer transaction, ready for signing. If you only have a token name or symbol, look it up: ``` -find_token(query: "USDC") +search_token(query: "USDC") ``` Note the `contract_address` and `decimals` from the result. diff --git a/internal/skills/files/spark-savings.md b/internal/skills/files/spark-savings.md index 95c16bb..11833ab 100644 --- a/internal/skills/files/spark-savings.md +++ b/internal/skills/files/spark-savings.md @@ -311,4 +311,4 @@ To redeem all shares, first query `balanceOf(address)` to get the exact share co - **DO NOT** call admin functions: `setDepositCap`, `setVsr`, `setVsrBounds`, `grantRole`, `revokeRole`, `take`, `drip`, `upgradeToAndCall`. These require privileged roles the user does not have. - **DO NOT** mix up decimals. Use the Decimals column in the address tables above. When in doubt, query `decimals()` on the vault. - **DO NOT** deposit more than `maxDeposit(address)` returns for the receiver. The vault may have a deposit cap. -- **DO NOT** use `find_token` to look up Spark vault tokens (spUSDT, spUSDC, etc.). They are not listed on CoinGecko. Use the addresses in this skill directly. +- **DO NOT** use `search_token` to look up Spark vault tokens (spUSDT, spUSDC, etc.). They are not listed on CoinGecko. Use the addresses in this skill directly. diff --git a/internal/tools/find_token.go b/internal/tools/search_token.go similarity index 96% rename from internal/tools/find_token.go rename to internal/tools/search_token.go index d8f6e0d..e994dc4 100644 --- a/internal/tools/find_token.go +++ b/internal/tools/search_token.go @@ -49,8 +49,8 @@ var platformToChain = map[string]string{ "zcash": "Zcash", } -func newFindTokenTool() mcp.Tool { - return mcp.NewTool("find_token", +func newSearchTokenTool() mcp.Tool { + return mcp.NewTool("search_token", mcp.WithDescription( "Search for tokens by ticker symbol, name, or contract address. "+ "Returns token metadata and all known contract deployments across chains, "+ @@ -64,7 +64,7 @@ func newFindTokenTool() mcp.Tool { ) } -func handleFindToken(cgClient *coingecko.Client) server.ToolHandlerFunc { +func handleSearchToken(cgClient *coingecko.Client) server.ToolHandlerFunc { return func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) { query, err := req.RequireString("query") if err != nil { diff --git a/internal/tools/tools.go b/internal/tools/tools.go index b1944b3..003e24f 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -20,7 +20,7 @@ func RegisterAll(s *server.MCPServer, store *vault.Store, ethClient *ethereum.Cl s.AddTool(newGetAddressTool(), handleGetAddress(store)) s.AddTool(newGetETHBalanceTool(), handleGetETHBalance(store, ethClient)) s.AddTool(newGetTokenBalanceTool(), handleGetTokenBalance(store, ethClient)) - s.AddTool(newFindTokenTool(), handleFindToken(cgClient)) + s.AddTool(newSearchTokenTool(), handleSearchToken(cgClient)) s.AddTool(newGetUTXOBalanceTool(), handleGetUTXOBalance(store, bcClient)) s.AddTool(newGetUTXOTransactionsTool(), handleGetUTXOTransactions(store, bcClient)) s.AddTool(newListUTXOsTool(), handleListUTXOs(store, bcClient)) diff --git a/internal/types/tokenresult.go b/internal/types/tokenresult.go index 387bb3c..fab8ffd 100644 --- a/internal/types/tokenresult.go +++ b/internal/types/tokenresult.go @@ -7,7 +7,7 @@ import ( "github.com/mark3labs/mcp-go/mcp" ) -// TokenSearchResult is the top-level JSON envelope returned by find_token. +// TokenSearchResult is the top-level JSON envelope returned by search_token. type TokenSearchResult struct { Tokens []TokenInfo `json:"tokens"` }