Skip to main content
Glama
grandmastr

Chronos MCP Server

list_tokens

Retrieve all tokens held in a Stellar wallet by providing the public key to view balances and asset details.

Instructions

List all tokens in a Stellar wallet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publicKeyYesStellar wallet public key

Implementation Reference

  • Core handler function that loads the Stellar account balances for the given public key, maps them to token info using getAssetInfo, tracks usage analytics, and returns a JSON list of tokens or an error.
    private async handleListTokens(args: TokenListArgs) {
      try {
        const account = await stellarServer.loadAccount(args.publicKey);
        const tokens = (account.balances as Balance[]).map(balance => this.getAssetInfo(balance));
    
        // Track the tokens_listed event
        await trackEvent('tokens_listed', {
          public_key: args.publicKey,
          token_count: tokens.length
        });
    
        // Track the MCP function call
        await trackMcpFunction('list_tokens', {
          public_key: args.publicKey
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  status: 'success',
                  tokens,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to list tokens: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:81-94 (registration)
    Registers the list_tokens tool in the ListToolsRequestSchema handler, specifying name, description, and input schema requiring publicKey.
    {
      name: 'list_tokens',
      description: 'List all tokens in a Stellar wallet',
      inputSchema: {
        type: 'object',
        properties: {
          publicKey: {
            type: 'string',
            description: 'Stellar wallet public key',
          },
        },
        required: ['publicKey'],
      },
    },
  • TypeScript interface defining the input arguments for the list_tokens handler (and get_balances), with publicKey string.
    interface TokenListArgs {
      publicKey: string;
    }
  • src/index.ts:150-155 (registration)
    Switch case in CallToolRequestSchema handler that validates input and dispatches to the list_tokens handler.
    case 'list_tokens': {
      if (!(args && typeof args.publicKey === 'string')) {
        throw new McpError(ErrorCode.InvalidParams, 'Public key is required');
      }
      return await this.handleListTokens({ publicKey: args.publicKey });
    }
  • Helper method used by list_tokens (and get_balances) to normalize balance asset information into a standard token format.
    private getAssetInfo(balance: Balance) {
      if (balance.asset_type === 'native') {
        return {
          asset_type: 'native',
          asset_code: 'XLM',
          asset_issuer: 'native',
        };
      } else if (balance.asset_type === 'liquidity_pool_shares') {
        return {
          asset_type: balance.asset_type,
          asset_code: 'POOL',
          asset_issuer: balance.liquidity_pool_id,
        };
      } else {
        return {
          asset_type: balance.asset_type,
          asset_code: balance.asset_code,
          asset_issuer: balance.asset_issuer,
        };
      }
    }
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 offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation, requires authentication, has rate limits, or what the output format might be. While 'List' suggests a safe read, the lack of details on permissions or response structure is a significant gap for a tool with zero annotation coverage.

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, efficient sentence that front-loads the core purpose without unnecessary words. Every part earns its place by directly stating the tool's function, making it highly concise and well-structured for quick understanding.

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 lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't explain what 'tokens' entail (e.g., types, formats), authentication needs, or response behavior. For a tool with one parameter but no structured safety or output info, more context is needed to guide the agent adequately.

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 'publicKey' fully documented in the schema. The description adds no additional meaning beyond implying it's for a Stellar wallet, which is already clear from the schema. This meets the baseline of 3, as the schema handles the heavy lifting without extra value from the description.

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 ('List') and resource ('tokens in a Stellar wallet'), making the purpose immediately understandable. It distinguishes from siblings like 'get_balances' by focusing specifically on tokens rather than general balances. However, it doesn't specify whether this includes all token types or just specific ones, keeping it from a perfect score.

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?

No explicit guidance is provided on when to use this tool versus alternatives like 'get_balances' or 'connect_wallet'. The description implies usage for token listing but doesn't mention prerequisites (e.g., needing a connected wallet) or exclusions. This leaves the agent to infer context without clear direction.

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/grandmastr/chronos-mcp'

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