Skip to main content
Glama
jun229

truemarkets-mcp-server

by jun229

Get account balances

tm_get_balances
Read-onlyIdempotent

Retrieve token balances for authenticated users across multiple blockchain networks, with optional filtering by specific chains like Solana or Base.

Instructions

Get token balances for the authenticated user across all chains.

Args:

  • chain (string, optional): Filter by "solana" or "base"

Returns: Array of { symbol, chain, balance, name }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoFilter by chain

Implementation Reference

  • The handler function for 'tm_get_balances' which fetches balances from the API and filters them by chain if provided.
      async ({ chain }) => {
        const resp = await api.getBalances();
        let balances = resp.balances ?? [];
    
        if (chain) {
          balances = balances.filter(
            (b) => b.chain?.toLowerCase() === chain
          );
        }
    
        const items = balances.map((b) => ({
          symbol: b.symbol ?? "",
          name: b.name ?? "",
          chain: b.chain ?? "",
          balance: b.balance ?? "0",
        }));
    
        const output = { count: items.length, balances: items };
    
        return {
          content: [{ type: "text", text: JSON.stringify(output, null, 2) }],
          structuredContent: output,
        };
      }
    );
  • The input schema and tool metadata for 'tm_get_balances'.
        {
          title: "Get account balances",
          description: `Get token balances for the authenticated user across all chains.
    
    Args:
      - chain (string, optional): Filter by "solana" or "base"
    
    Returns: Array of { symbol, chain, balance, name }`,
          inputSchema: {
            chain: z.enum(["solana", "base"]).optional().describe("Filter by chain"),
          },
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: true,
          },
        },
  • Registration of the 'tm_get_balances' tool within the server.
    server.registerTool(
      "tm_get_balances",
Behavior4/5

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

The description adds valuable context beyond annotations: it specifies the scope ('across all chains'), mentions authentication requirement ('authenticated user'), and describes the return format. While annotations already declare readOnlyHint=true, destructiveHint=false, etc., the description provides operational context about what data is returned and authentication needs.

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 perfectly front-loaded with the core purpose in the first sentence, followed by clear parameter and return value sections. Every sentence earns its place with zero wasted words, making it easy for an AI agent to quickly understand the tool's function.

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

Completeness5/5

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

Given the tool's low complexity (one optional parameter), comprehensive annotations covering safety and behavior, and clear description of return values, this description is complete enough. No output schema exists, but the description adequately explains what's returned, making it sufficient for agent understanding.

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?

With 100% schema description coverage, the schema already fully documents the single optional parameter. The description adds minimal value beyond the schema by mentioning the filter capability but doesn't provide additional syntax, format details, or usage examples beyond what's in the schema.

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

Purpose5/5

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

The description clearly states the specific action ('Get token balances'), target resource ('for the authenticated user'), and scope ('across all chains'). It distinguishes from siblings like tm_get_price (price data) and tm_list_assets (asset listing) by focusing on user-specific balance retrieval.

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

Usage Guidelines4/5

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

The description provides clear context about when to use it (to get token balances for authenticated user), but doesn't explicitly state when NOT to use it or name specific alternatives. It implies usage for balance queries vs. siblings like tm_execute_trade for trading or tm_get_profile for profile data.

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/jun229/tm-mcp-server'

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