Skip to main content
Glama
covalenthq

GoldRush MCP Server

by covalenthq

token_approvals

Check token approvals and security risks for a wallet's assets across multiple blockchain networks. Identify which contracts can spend your tokens and assess potential vulnerabilities.

Instructions

Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet's assets. Required: chainName (blockchain network, e.g. eth-mainnet or 1), walletAddress (wallet address, supports ENS, RNS, Lens Handle, or Unstoppable Domain). Returns a list of ERC20 token approvals and their associated security risk levels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNameYesThe blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet').
walletAddressYesThe wallet address to get token approvals for. Supports wallet addresses, ENS, RNS, Lens Handle, or Unstoppable Domain names.

Implementation Reference

  • The handler function that executes the 'token_approvals' tool logic by calling the GoldRushClient's SecurityService.getApprovals method.
    async (params) => {
        try {
            const response =
                await goldRushClient.SecurityService.getApprovals(
                    params.chainName as Chain,
                    params.walletAddress
                );
            return {
                content: [
                    {
                        type: "text",
                        text: stringifyWithBigInt(response.data),
                    },
                ],
            };
        } catch (error) {
            return {
                content: [{ type: "text", text: `Error: ${error}` }],
                isError: true,
            };
        }
    }
  • The tool registration block for 'token_approvals' within the SecurityService.
    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) as [string, ...string[]])
                .describe(
                    "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
                ),
            walletAddress: z
                .string()
                .describe(
                    "The wallet address to get token approvals for. Supports wallet addresses, ENS, RNS, Lens Handle, or Unstoppable Domain names."
                ),
        },
        async (params) => {
            try {
                const response =
                    await goldRushClient.SecurityService.getApprovals(
                        params.chainName as Chain,
                        params.walletAddress
                    );
                return {
                    content: [
                        {
                            type: "text",
                            text: stringifyWithBigInt(response.data),
                        },
                    ],
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `Error: ${error}` }],
                    isError: true,
                };
            }
        }
    );
  • Input schema definition for the 'token_approvals' tool using Zod.
    {
        chainName: z
            .enum(Object.values(ChainName) as [string, ...string[]])
            .describe(
                "The blockchain network to query (e.g., 'eth-mainnet', 'matic-mainnet', 'bsc-mainnet')."
            ),
        walletAddress: z
            .string()
            .describe(
                "The wallet address to get token approvals for. Supports wallet addresses, ENS, RNS, Lens Handle, or Unstoppable Domain names."
            ),
    },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full disclosure burden. Adds valuable behavioral context: data is 'categorized by spenders' and includes 'security risk levels'. However, misses operational details like read-only safety, pagination, or specific risk level definitions that annotations would typically cover.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three efficiently structured sentences: purpose with categorization detail, required parameters with format examples, and return value specification. Every sentence conveys unique information with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter data retrieval tool without output schema, description adequately explains return values ('list of ERC20 token approvals and their associated security risk levels'). Missing pagination details or explicit safety confirmation, but sufficiently complete for tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% description coverage establishing baseline 3. Description adds value by emphasizing walletAddress supports 'ENS, RNS, Lens Handle, or Unstoppable Domain' and explicitly marking both parameters as 'Required', reinforcing critical constraints beyond schema structure.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'get' with clear resource 'approvals across all token contracts' and distinguishes from siblings like token_balances by specifying 'categorized by spenders' and 'security risk levels'. The scope is precisely defined as ERC20 token approvals.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Opens with 'Commonly used to' implying typical usage, but lacks explicit when-to-use guidance versus alternatives like token_balances or erc20_token_transfers. No exclusions or prerequisites stated, though the specificity of 'approvals' provides implicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/covalenthq/goldrush-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server