Skip to main content
Glama
lordbasilaiassistant-sudo

base-security-scanner-mcp

check_token_permissions

Analyze token contract permissions to verify minting, pausing, blacklisting, fee changes, trading restrictions, and ownership status on Base mainnet.

Instructions

Check owner permissions on a token: can mint? can pause? can blacklist? can change fees? Can disable trading? Ownership renounced?

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_addressYesToken contract address on Base mainnet

Implementation Reference

  • Implementation of the check_token_permissions MCP tool. It retrieves the contract bytecode, extracts selectors, checks for specific dangerous function selectors, retrieves ownership information, and summarizes the findings.
    server.tool(
      "check_token_permissions",
      "Check owner permissions on a token: can mint? can pause? can blacklist? can change fees? Can disable trading? Ownership renounced?",
      {
        token_address: z.string().describe("Token contract address on Base mainnet"),
      },
      async ({ token_address }) => {
        try {
          const code = await getContractBytecode(token_address);
          if (code === "0x" || code.length <= 2) {
            return ok({ token: token_address, isContract: false, message: "Not a contract" });
          }
    
          const selectors = extractSelectors(code);
          const ownership = await checkOwnership(token_address);
    
          const permissions: Record<string, { present: boolean; risk: string; detail: string }> = {
            canMint: {
              present: selectors.includes("40c10f19"),
              risk: "critical",
              detail: "mint(address,uint256) -- can create new tokens",
            },
            canPause: {
              present: selectors.includes("8456cb59"),
              risk: "high",
              detail: "pause() -- can freeze all transfers",
            },
            canBlacklist: {
              present: selectors.includes("44337ea1"),
              risk: "high",
              detail: "blacklist(address) -- can block specific addresses",
            },
            canChangeFees: {
              present: selectors.includes("69fe0e2d"),
              risk: "high",
              detail: "setFee(uint256) -- can change transaction fees",
            },
            canDisableTrading: {
              present: selectors.includes("1a8145bb"),
              risk: "critical",
              detail: "setTradingActive(bool) -- can disable all trading",
            },
            canSetMaxTx: {
              present: selectors.includes("e4748b9e"),
              risk: "high",
              detail: "setMaxTxAmount(uint256) -- can restrict transaction sizes",
            },
            canSetMaxWallet: {
              present: selectors.includes("8ee88c53"),
              risk: "high",
              detail: "setMaxWalletSize(uint256) -- can restrict wallet holdings",
            },
            canBurnOthers: {
              present: selectors.includes("79cc6790"),
              risk: "medium",
              detail: "burnFrom(address,uint256) -- can burn tokens from other addresses",
            },
            canUpgrade: {
              present: selectors.includes("3659cfe6") || selectors.includes("4f1ef286"),
              risk: "critical",
              detail: "upgradeTo/upgradeToAndCall -- proxy can be upgraded to new logic",
            },
            canRenounceOwnership: {
              present: selectors.includes("715018a6"),
              risk: "info",
              detail: "renounceOwnership() -- ownership can be given up (positive sign)",
            },
            canTransferOwnership: {
              present: selectors.includes("f2fde38b"),
              risk: "medium",
              detail: "transferOwnership(address) -- ownership can be moved to another address",
            },
          };
    
          const dangerousPermissions = Object.entries(permissions)
            .filter(([, v]) => v.present && (v.risk === "critical" || v.risk === "high"))
            .map(([k]) => k);
    
          return ok({
            token: token_address,
            ownership: serializeBigInts(ownership) as Record<string, unknown>,
            permissions,
            dangerousPermissions,
            riskSummary: dangerousPermissions.length === 0
              ? "No dangerous owner permissions detected"
              : `${dangerousPermissions.length} dangerous permission(s) found: ${dangerousPermissions.join(", ")}`,
          });
        } catch (err) {
          return fail(`check_token_permissions failed: ${err instanceof Error ? err.message : String(err)}`);
        }
      }
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool does (checks specific permissions) and implies it's a read-only operation (no destructive actions mentioned). However, it doesn't specify whether this requires blockchain access, rate limits, authentication needs, or what format the results will be in (since no output schema exists).

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?

The description is extremely concise and front-loaded, using a single efficient sentence that lists all relevant permissions without unnecessary words. Every element (the action, target, and specific permission checks) earns its place, making it easy to parse while being information-dense.

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

Completeness3/5

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

Given the tool's moderate complexity (checking multiple permissions), no annotations, and no output schema, the description does a good job explaining what's being checked but leaves gaps. It doesn't describe the return format, error conditions, or how results are presented. For a permission-checking tool with no structured output documentation, this creates some ambiguity about what the agent should expect.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'token_address' well-documented in the schema as 'Token contract address on Base mainnet.' The description doesn't add any additional parameter information beyond what's already in the schema, so it meets the baseline score of 3 for high schema coverage.

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?

The description clearly states the tool's purpose with specific verbs ('check owner permissions') and enumerates the exact permissions being checked (mint, pause, blacklist, change fees, disable trading, ownership renounced). It distinguishes itself from sibling tools like 'get_contract_info' or 'detect_rug_risk' by focusing specifically on permission verification rather than general analysis or risk detection.

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?

The description implies usage context by specifying what permissions are checked, suggesting it should be used when evaluating token security or ownership control. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_contract_info' (which might include permission data) or 'detect_rug_risk' (which might assess similar risks). No explicit exclusions or prerequisites are mentioned.

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/lordbasilaiassistant-sudo/base-security-scanner-mcp'

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