Skip to main content
Glama

get-token

Retrieve token details from blockchain networks using wallet addresses and chain IDs to verify asset information.

Instructions

Get the token information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
chainIdNo

Implementation Reference

  • The execute function (handler) for the 'get-token' tool. Fetches token information using wagmi's getToken for the given address and optional chainId, then stringifies and returns the result.
    execute: async (args) => {
      const address = args.address as Address
      const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
      const result = await getToken(wagmiConfig, {
        address,
        chainId,
      })
      return {
        content: [
          {
            type: "text",
            text: JSONStringify(result),
          },
        ],
      }
  • Zod schema defining input parameters: address (string) and optional chainId (number).
    parameters: z.object({
      address: z.string(),
      chainId: z.coerce.number().optional(),
    }),
  • Registers the 'get-token' tool on the FastMCP server, including name, description, parameters schema, and execute handler.
    server.addTool({
      name: "get-token",
      description: "Get the token information",
      parameters: z.object({
        address: z.string(),
        chainId: z.coerce.number().optional(),
      }),
      execute: async (args) => {
        const address = args.address as Address
        const chainId = args.chainId as typeof wagmiConfig['chains'][number]['id']
        const result = await getToken(wagmiConfig, {
          address,
          chainId,
        })
        return {
          content: [
            {
              type: "text",
              text: JSONStringify(result),
            },
          ],
        }
      },
    });
  • Invokes the registerGetTokenTools function to add the 'get-token' tool to the main MCP server instance.
    registerGetTokenTools(server);
  • Exports the get-token tool registration function from the tools index for use in the main index.
    export * from "./get-token.js";
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. However, it only states the action ('Get') without any details about what the tool returns (e.g., format, structure), error conditions, rate limits, authentication needs, or side effects. For a tool with parameters and no output schema, this lack of behavioral context is a significant gap.

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

Conciseness4/5

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

The description is extremely concise with just three words, which is efficient and front-loaded. However, this brevity borders on under-specification—it lacks necessary detail for a tool with parameters and no output schema. While there's no wasted text, the description fails to earn its place by omitting essential context.

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

Completeness1/5

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

Given the complexity (2 parameters, 0% schema coverage, no output schema, no annotations), the description is completely inadequate. It doesn't explain what token information is retrieved, how to use the parameters, what the return value looks like, or how this tool differs from siblings. For a tool in a blockchain context with multiple similar tools, this leaves too many unanswered questions.

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

Parameters1/5

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

The schema description coverage is 0%, meaning parameters 'address' and 'chainId' are undocumented in the schema. The description adds no meaning beyond the schema—it doesn't explain what 'address' refers to (e.g., token contract address), what 'chainId' is used for, or how they interact. With two parameters and no compensation in the description, this leaves critical input semantics unclear.

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

Purpose2/5

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

The description 'Get the token information' is a tautology that essentially restates the tool name 'get-token'. While it indicates the tool retrieves token-related data, it lacks specificity about what 'token information' includes (e.g., metadata, balance, contract details) and doesn't distinguish this tool from sibling tools like 'get-token-balance' or 'get-native-currency-balance'. This creates ambiguity about the exact resource being accessed.

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

Usage Guidelines1/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 (e.g., needing a token address), differentiate from similar tools like 'get-token-balance' (which might retrieve balance rather than general information), or specify contexts where this tool is appropriate. Users are left to infer usage from the tool name alone.

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/Xiawpohr/mcpilot'

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