Skip to main content
Glama

listAccounts

Retrieve all configured cryptocurrency exchange account names from the CCXT MCP Server to access trading capabilities across multiple platforms.

Instructions

List all configured account names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'listAccounts' tool. It fetches account names using ccxtServer.getAccountNames(), handles the case with no accounts by providing configuration instructions, and returns a formatted text list of accounts.
        async () => {
          console.error(`[DEBUG] listAccounts tool called`);
          const accountNames = ccxtServer.getAccountNames();
          
          if (accountNames.length === 0) {
            console.error(`[WARN] No accounts found in listAccounts tool`);
            return {
              content: [
                {
                  type: "text",
                  text: `No accounts were loaded from the configuration. Please check your config file at: ${ccxtServer['configPath']}
                  
    Possible issues:
    1. The config file doesn't exist
    2. The config file doesn't have the correct format (should have an 'accounts' array)
    3. API keys in the config file are invalid
    4. Permission issues with accessing the config file
                  
    Your config should look like:
    {
      "accounts": [
        {
          "name": "account_name",
          "exchangeId": "exchange_id", 
          "apiKey": "your_api_key",
          "secret": "your_secret_key",
          "defaultType": "spot"
        }
      ]
    }`,
                },
              ],
            };
          }
          
          console.error(`[DEBUG] Returning ${accountNames.length} accounts from listAccounts tool`);
          return {
            content: [
              {
                type: "text",
                text: `Configured accounts (${accountNames.length}):\n${accountNames.join("\n")}`,
              },
            ],
          };
        }
  • Direct registration of the 'listAccounts' tool using server.tool(), including name, description, empty input schema, and inline handler function.
      server.tool(
        "listAccounts",
        "List all configured account names",
        {},
        async () => {
          console.error(`[DEBUG] listAccounts tool called`);
          const accountNames = ccxtServer.getAccountNames();
          
          if (accountNames.length === 0) {
            console.error(`[WARN] No accounts found in listAccounts tool`);
            return {
              content: [
                {
                  type: "text",
                  text: `No accounts were loaded from the configuration. Please check your config file at: ${ccxtServer['configPath']}
                  
    Possible issues:
    1. The config file doesn't exist
    2. The config file doesn't have the correct format (should have an 'accounts' array)
    3. API keys in the config file are invalid
    4. Permission issues with accessing the config file
                  
    Your config should look like:
    {
      "accounts": [
        {
          "name": "account_name",
          "exchangeId": "exchange_id", 
          "apiKey": "your_api_key",
          "secret": "your_secret_key",
          "defaultType": "spot"
        }
      ]
    }`,
                },
              ],
            };
          }
          
          console.error(`[DEBUG] Returning ${accountNames.length} accounts from listAccounts tool`);
          return {
            content: [
              {
                type: "text",
                text: `Configured accounts (${accountNames.length}):\n${accountNames.join("\n")}`,
              },
            ],
          };
        }
      );
  • src/server.ts:374-374 (registration)
    Top-level call to registerAccountTools in CcxtMcpServer's registerTools() method, which registers the listAccounts tool among others.
    registerAccountTools(this.server, this);
  • Helper method in CcxtMcpServer that returns the list of loaded account names from exchangeInstances, directly used by the listAccounts handler.
    getAccountNames(): string[] {
      const accountNames = Object.keys(this.exchangeInstances);
      console.error(`[DEBUG] getAccountNames() called, returning ${accountNames.length} accounts: ${accountNames.join(', ')}`);
      return accountNames;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'lists' accounts, implying a read-only operation, but doesn't specify if it requires authentication, returns structured data, or has rate limits. This is inadequate 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 directly states the tool's function without unnecessary words. It is front-loaded and wastes no space, making it ideal for quick comprehension.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. However, it lacks details on return format (e.g., list structure) and behavioral context, which would enhance completeness for even a simple tool.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add parameter details, but this is appropriate given the schema fully covers the absence of inputs, warranting a baseline score above minimum viable.

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 ('all configured account names'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'fetchBalance' or 'fetchMarkets' that might also involve account-related operations, preventing 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?

The description provides no guidance on when to use this tool versus alternatives like 'fetchBalance' or other account-related siblings. It lacks context about prerequisites (e.g., whether accounts must be configured first) or exclusions, leaving usage ambiguous.

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/lazy-dinosaur/ccxt-mcp'

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