UNPKG

@covalenthq/goldrush-mcp-server

Version:

GoldRush MCP Server for interacting with Covalent GoldRush API

30 lines 1.33 kB
import { stringifyWithBigInt } from "../utils/helpers.js"; import { ChainName, } from "@covalenthq/client-sdk"; import { z } from "zod"; export function addSecurityServiceTools(server, goldRushClient) { server.tool("token_approvals", "Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet's assets.\n" + "Required: chainName (blockchain network, e.g. eth-mainnet or 1), walletAddress (wallet address, supports ENS, RNS, Lens Handle, or Unstoppable Domain).\n" + "Returns a list of ERC20 token approvals and their associated security risk levels.", { chainName: z.enum(Object.values(ChainName)), walletAddress: z.string(), }, async (params) => { try { const response = await goldRushClient.SecurityService.getApprovals(params.chainName, params.walletAddress); return { content: [ { type: "text", text: stringifyWithBigInt(response.data), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error}` }], isError: true, }; } }); } //# sourceMappingURL=SecurityService.js.map