Skip to main content
Glama
lordbasilaiassistant-sudo

base-gasless-deploy-mcp

get_token_info

Retrieve ERC-20 token details including name, symbol, decimals, total supply, and owner balance from a Base contract address.

Instructions

Get info about a deployed ERC-20 token: name, symbol, decimals, total supply, and owner balance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_addressYesToken contract address on Base

Implementation Reference

  • Handler for the get_token_info tool, which queries an ERC-20 token's metadata and supply using ethers.js.
    async ({ token_address }) => {
      try {
        const provider = getProvider();
        const token = new ethers.Contract(token_address, TOKEN_ABI, provider);
    
        const [name, symbol, decimals, totalSupply] = await Promise.all([
          token.name(),
          token.symbol(),
          token.decimals(),
          token.totalSupply(),
        ]);
    
        // Check if we have deploy record
        const record = deployments.find(
          (d) => d.tokenAddress.toLowerCase() === token_address.toLowerCase()
        );
    
        const result: Record<string, unknown> = {
          token_address,
          name,
          symbol,
          decimals: Number(decimals),
          total_supply: ethers.formatUnits(totalSupply, decimals),
          explorer: `https://basescan.org/token/${token_address}`,
        };
    
        if (record) {
          result.owner = record.owner;
          result.deployer = record.deployer;
          result.deployed_at = new Date(record.timestamp * 1000).toISOString();
          result.was_gasless = record.usedPaymaster;
    
          // Get owner balance
          const ownerBalance = await token.balanceOf(record.owner);
          result.owner_balance = ethers.formatUnits(ownerBalance, decimals);
  • src/index.ts:216-221 (registration)
    Registration of the get_token_info tool with its schema definition using zod.
    server.tool(
      "get_token_info",
      "Get info about a deployed ERC-20 token: name, symbol, decimals, total supply, and owner balance.",
      {
        token_address: z.string().describe("Token contract address on Base"),
      },

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-gasless-deploy-mcp'

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