Get the agent's Grip wallet info
grip_walletRetrieves the agent's Grip Pay wallet address and current USDC balance on Base mainnet. Use to check wallet details or confirm funds before payments.
Instructions
Returns this agent's Grip Pay wallet address (Base mainnet smart account) and current USDC balance. Use this when the human asks about the wallet, where to fund it, how much USDC the agent has, or before suggesting any payment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server/src/index.ts:117-154 (registration)Registration of the 'grip_wallet' tool via server.registerTool with input schema and metadata (readOnlyHint, etc.)
server.registerTool( "grip_wallet", { title: "Get the agent's Grip wallet info", description: "Returns this agent's Grip Pay wallet address (Base mainnet smart account) and current USDC balance. Use this when the human asks about the wallet, where to fund it, how much USDC the agent has, or before suggesting any payment.", inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async () => { try { const addr = await smartAddress(); const balance = await client.balance(); const text = [ `Grip wallet (Base mainnet)`, ``, `Address: ${addr}`, `Balance: ${balance.formatted} USDC`, `Per-tx cap: ${PER_TX_CAP} USDC`, `Daily cap: ${DAILY_CAP} USDC (spent today: ${todaySpent().toFixed(2)})`, ``, `To fund: send USDC on Base to the address above.`, `Basescan: https://basescan.org/address/${addr}`, ].join("\n"); return { content: [{ type: "text", text }] }; } catch (e) { return { content: [{ type: "text", text: `Could not read wallet: ${(e as Error).message}` }], isError: true, }; } }, ); - server/src/index.ts:131-153 (handler)Handler function that calls smartAddress() and client.balance() to return wallet address and USDC balance as text content
async () => { try { const addr = await smartAddress(); const balance = await client.balance(); const text = [ `Grip wallet (Base mainnet)`, ``, `Address: ${addr}`, `Balance: ${balance.formatted} USDC`, `Per-tx cap: ${PER_TX_CAP} USDC`, `Daily cap: ${DAILY_CAP} USDC (spent today: ${todaySpent().toFixed(2)})`, ``, `To fund: send USDC on Base to the address above.`, `Basescan: https://basescan.org/address/${addr}`, ].join("\n"); return { content: [{ type: "text", text }] }; } catch (e) { return { content: [{ type: "text", text: `Could not read wallet: ${(e as Error).message}` }], isError: true, }; } }, - server/src/index.ts:119-129 (schema)Input schema (empty object) and annotations for the grip_wallet tool (readOnlyHint, idempotentHint, etc.)
{ title: "Get the agent's Grip wallet info", description: "Returns this agent's Grip Pay wallet address (Base mainnet smart account) and current USDC balance. Use this when the human asks about the wallet, where to fund it, how much USDC the agent has, or before suggesting any payment.", inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, - server/src/index.ts:64-68 (helper)Helper function smartAddress() that lazily resolves the smart account address via client.address()
async function smartAddress(): Promise<string> { if (_smartAddr) return _smartAddr; _smartAddr = (await client.address()) as string; return _smartAddr; }