get_scarab_balance
Check SCARAB token balance for any wallet address to monitor staking and governance holdings in the Maiat Protocol.
Instructions
Get the SCARAB token balance for an address. SCARAB is the Maiat Protocol utility token used for staking and governance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Wallet address (0x...) to check SCARAB balance for |
Implementation Reference
- packages/mcp-server/src/index.ts:314-333 (handler)The MCP tool handler for 'get_scarab_balance' in the mcp-server package. It delegates to `sdk.scarab(address)`.
async ({ address }) => { try { const data = await sdk.scarab(address); return { content: [ { type: "text" as const, text: JSON.stringify(data, null, 2), }, ], }; } catch (err) { return { content: [ { type: "text" as const, text: JSON.stringify({ error: err instanceof Error ? err.message : String(err), address, }), - packages/mcp-server/src/index.ts:306-313 (registration)Registration of the 'get_scarab_balance' tool in the MCP server.
server.tool( "get_scarab_balance", "Get the SCARAB token balance for an address. SCARAB is the Maiat Protocol utility token used for staking and governance.", { address: z .string() .describe("Wallet address (0x...) to check SCARAB balance for"), }, - src/lib/scarab-rewards.ts:60-66 (handler)The core business logic function 'getScarabBalance' which interacts with the database.
export async function getScarabBalance(walletAddress: string): Promise<number> { const normalized = walletAddress.toLowerCase(); const bal = await prisma.scarabBalance.findUnique({ where: { address: normalized }, }); return bal?.balance ?? 0; }