Skip to main content
Glama

get-token-info

Retrieve detailed information about any Pump.fun token on Solana by providing its mint address, enabling users to verify token data and make informed decisions.

Instructions

Get information about a Pump.fun token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenAddressYesThe token's mint address

Implementation Reference

  • Core handler function that initializes SDK, fetches bonding curve account for the token, computes formatted supply, and returns token info.
    export async function getTokenInfo(tokenAddress: string) {
      const { sdk } = initializeSDK();
      console.log("SDK initialized");
    
      const mintPublicKey = new PublicKey(tokenAddress);
      console.log("Getting bonding curve account...");
      const bondingCurveAccount = await sdk.getBondingCurveAccount(mintPublicKey);
    
      if (!bondingCurveAccount) {
        console.log(`No token found with address ${tokenAddress}`);
        return null;
      }
    
      const tokenTotalSupply = (bondingCurveAccount as any).tokenTotalSupply;
      const formattedSupply = tokenTotalSupply
        ? Number(tokenTotalSupply) / Math.pow(10, DEFAULT_DECIMALS)
        : "Unknown";
    
      return {
        tokenAddress,
        bondingCurveAccount,
        formattedSupply,
        pumpfunUrl: `https://pump.fun/${tokenAddress}`,
      };
    }
  • Zod input schema defining the 'tokenAddress' parameter for the tool.
    {
      tokenAddress: z.string().describe("The token's mint address"),
    },
  • src/index.ts:56-96 (registration)
    Registers the 'get-token-info' tool on the MCP server, including schema, description, and wrapper handler that calls the core getTokenInfo function.
    server.tool(
      "get-token-info",
      "Get information about a Pump.fun token",
      {
        tokenAddress: z.string().describe("The token's mint address"),
      },
      async ({ tokenAddress }, extra) => {
        try {
          console.error(`Checking token info for: ${tokenAddress}`);
    
          const tokenInfo = await getTokenInfo(tokenAddress);
    
          if (!tokenInfo) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `No token found with address ${tokenAddress}`,
                },
              ],
            };
          }
    
          const formattedInfo = formatTokenInfo(tokenInfo);
    
          return createMcpResponse(formattedInfo);
        } catch (error: any) {
          console.error("Error getting token info:", error);
          return {
            content: [
              {
                type: "text" as const,
                text: `Error getting token info: ${
                  error?.message || "Unknown error"
                }`,
              },
            ],
          };
        }
      }
    );
  • Helper function to initialize the PumpFunSDK and Solana connection using environment RPC URL.
    export function initializeSDK() {
      const rpcUrl = process.env.HELIUS_RPC_URL;
      if (!rpcUrl) {
        throw new Error("HELIUS_RPC_URL environment variable is not set");
      }
    
      const connection = new Connection(rpcUrl);
      const provider = new AnchorProvider(
        connection,
        {
          publicKey: new PublicKey("11111111111111111111111111111111"),
          signTransaction: async () => {
            throw new Error("Not implemented");
          },
          signAllTransactions: async () => {
            throw new Error("Not implemented");
          },
        },
        { commitment: "confirmed" }
      );
    
      return {
        sdk: new PumpFunSDK(provider),
        connection,
      };
    }
  • Helper function to format the token information into a human-readable string.
    export function formatTokenInfo(
      tokenInfo: ReturnType<typeof getTokenInfo> extends Promise<infer T>
        ? NonNullable<T>
        : never
    ) {
      return [
        `Token: ${tokenInfo.tokenAddress}`,
        `Supply: ${tokenInfo.formattedSupply}`,
        `Pump.fun URL: ${tokenInfo.pumpfunUrl}`,
      ].join("\n");
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, potential rate limits, authentication needs, error conditions, or what kind of information is returned, which are critical for a tool interacting with external services.

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 a single, direct sentence with zero waste, efficiently conveying the core purpose without unnecessary elaboration. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity of interacting with a token system and the lack of annotations and output schema, the description is incomplete. It doesn't explain what information is returned, error handling, or behavioral context, leaving significant gaps for an agent to understand the tool's full operation.

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 parameter 'tokenAddress' well-documented in the schema. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, but the schema adequately covers the single parameter, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the action ('Get information') and resource ('about a Pump.fun token'), making the purpose immediately understandable. It doesn't specifically differentiate from siblings like 'get-account-balance' which might also retrieve information, but it's sufficiently clear about what information is being retrieved.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or how it differs from sibling tools like 'get-account-balance' or 'list-accounts', leaving the agent to infer usage scenarios.

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/dexoryn/pumpfun-mcp-server'

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