Skip to main content
Glama

TOKEN_LIST

Retrieve available tokens for trading on a specified blockchain network through the OpenOcean MCP server.

Instructions

Get token list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoThe blockchain network to execute the transaction on. uses fraxtal as defaultfraxtal

Implementation Reference

  • The main handler function that executes the TOKEN_LIST tool. It resolves the chain, calls ChainService.tokenList, handles errors, and returns JSON stringified token list.
    export const tokenList = async (args: z.infer<typeof chainParamsSchema>) => {
    	try {
    		const inputChain = args.chain.toLowerCase();
    		const chainObject = getChainFromName(inputChain);
    
    		console.error(`[TOKEN_LIST] Using chain: ${chainObject.name}`);
    
    		const service = new ChainService();
    		const tokenList = await service.tokenList(chainObject.id);
    		if (tokenList instanceof Error) {
    			return `Error fetching tokenList: ${tokenList.message}`;
    		}
    
    		return JSON.stringify(tokenList, null, 2);
    	} catch (error: unknown) {
    		const message =
    			error instanceof Error
    				? error.message
    				: "An unknown error occurred while fetching tokenList.";
    		console.error(`[TOKEN_LIST] Error: ${message}`);
    		throw new Error(`Failed to fetch tokenList: ${message}`);
    	}
  • Zod schema defining the input parameters for the TOKEN_LIST tool: optional chain name, defaults to 'fraxtal'.
    export const chainParamsSchema = z.object({
    	chain: z
    		.string()
    		.optional()
    		.describe(
    			"The blockchain network to execute the transaction on. uses fraxtal as default",
    		)
    		.default("fraxtal")
    });
  • Tool registration object exporting the TOKEN_LIST tool with name, description, input schema, and handler reference.
    tokenList: {
    	name: "TOKEN_LIST",
    	description: "Get token list",
    	parameters: chainParamsSchema,
    	execute: chainExecute.tokenList
Behavior2/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. 'Get token list' implies a read operation, but it doesn't specify whether this is a safe query, requires authentication, has rate limits, or what the return format might be. For a tool with zero annotation coverage, this is inadequate, as it leaves key behavioral traits undefined.

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 'Get token list' is extremely concise with no wasted words, making it front-loaded and easy to parse. However, it's arguably too brief, bordering on under-specification, which slightly reduces its effectiveness. It earns a high score for efficiency but loses a point for potential lack of clarity due to brevity.

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 tool's complexity (simple with 1 parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'token list' entails, how results are returned, or any behavioral aspects. For a tool in this context, the description should provide more detail to be fully helpful, making it inadequate.

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?

The input schema has 1 parameter with 100% description coverage, detailing 'chain' as the blockchain network with a default. The description adds no parameter semantics beyond what the schema provides. According to the rules, with high schema coverage (>80%), the baseline is 3, which applies here as the description doesn't compensate or add value.

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

Purpose3/5

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

The description 'Get token list' states a verb ('Get') and resource ('token list'), providing a basic purpose. However, it's vague about what 'token list' means (e.g., tokens on a blockchain, tokens in a wallet, or something else) and doesn't distinguish from siblings like CHAIN_LIST or DEX_LIST. It meets the minimum viable standard but lacks specificity.

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 context, prerequisites, or exclusions, and with siblings like CHAIN_LIST and DEX_LIST that might overlap in domain, the absence of usage guidelines is a clear gap. This falls short of implied usage.

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/openocean-finance/openocean-mcp'

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