Skip to main content
Glama
AdamikHQ

Adamik MCP Server

Official

getAccountState

Retrieve account balances and staking positions across blockchain networks, automatically converting raw amounts to human-readable formats using verified decimal precision.

Instructions

Get the state of an account (balances and staking positions). CRITICAL: Balance amounts are returned in SMALLEST UNITS (wei for ETH, satoshis for BTC, µATOM for ATOM, etc.). NEVER show raw amounts to users! Always convert first! MANDATORY CONVERSION STEPS - ALWAYS CALL THESE ENDPOINTS: 1. For NATIVE currency: MUST call listFeatures(chainId) first to get the exact decimal places - NEVER assume! 2. For TOKENS: MUST call getTokenDetails(chainId, tokenId) for each token to get its exact decimals - NEVER assume! 3. Convert ALL amounts: human_readable = raw_amount ÷ 10^decimals (using the decimals from the API calls above) 4. Present in human-readable format to users COMMON ERRORS TO AVOID: • ATOM: Raw '4191769000' with 6 decimals = 4.191769 ATOM (NOT 4,191.769 ATOM!) • ETH: Raw '5354656887913579' with 18 decimals = 0.005354656887913579 ETH (NOT 5.35 ETH!) • Always divide by 10^decimals, check your decimal point placement!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdYes
accountIdYes

Implementation Reference

  • The handler function for the getAccountState tool. It takes chainId and accountId as parameters, makes an API request to the Adamik API to fetch the account state, stringifies the response, and returns it as text content.
    async ({ chainId, accountId }: GetAccountStatePathParams) => {
      const state = await makeApiRequest<GetAccountStateResponse>(
        `${ADAMIK_API_BASE_URL}/${chainId}/account/${accountId}/state`,
        ADAMIK_API_KEY
      );
    
      const text = JSON.stringify(state);
      return {
        content: [
          {
            type: "text",
            text,
          },
        ],
      };
    }
  • src/module.ts:316-354 (registration)
    Registration of the getAccountState tool using McpServer.tool(), including detailed description emphasizing decimal handling, inline input schema, and the handler function.
    server.tool(
      "getAccountState",
      [
        "Get the state of an account (balances and staking positions).",
        "CRITICAL: Balance amounts are returned in SMALLEST UNITS (wei for ETH, satoshis for BTC, µATOM for ATOM, etc.).",
        "NEVER show raw amounts to users! Always convert first!",
        "\n",
        "MANDATORY CONVERSION STEPS - ALWAYS CALL THESE ENDPOINTS:",
        "1. For NATIVE currency: MUST call listFeatures(chainId) first to get the exact decimal places - NEVER assume!",
        "2. For TOKENS: MUST call getTokenDetails(chainId, tokenId) for each token to get its exact decimals - NEVER assume!",
        "3. Convert ALL amounts: human_readable = raw_amount ÷ 10^decimals (using the decimals from the API calls above)",
        "4. Present in human-readable format to users",
        "\n",
        "COMMON ERRORS TO AVOID:",
        "• ATOM: Raw '4191769000' with 6 decimals = 4.191769 ATOM (NOT 4,191.769 ATOM!)",
        "• ETH: Raw '5354656887913579' with 18 decimals = 0.005354656887913579 ETH (NOT 5.35 ETH!)",
        "• Always divide by 10^decimals, check your decimal point placement!",
      ].join(" "),
      {
        chainId: ChainIdSchema,
        accountId: z.string(),
      },
      async ({ chainId, accountId }: GetAccountStatePathParams) => {
        const state = await makeApiRequest<GetAccountStateResponse>(
          `${ADAMIK_API_BASE_URL}/${chainId}/account/${accountId}/state`,
          ADAMIK_API_KEY
        );
    
        const text = JSON.stringify(state);
        return {
          content: [
            {
              type: "text",
              text,
            },
          ],
        };
      }
    );
  • Zod schema and TypeScript type for GetAccountStatePathParams (input parameters: chainId and accountId).
    export const GetAccountStatePathParamsSchema = z.object({
      chainId: ChainIdSchema,
      accountId: z.string(),
    });
    export type GetAccountStatePathParams = z.infer<typeof GetAccountStatePathParamsSchema>;
  • Zod schema and TypeScript type for GetAccountStateResponse (output structure including balances for native, tokens, and staking).
    export const GetAccountStateResponseSchema = z.object({
      chainId: ChainIdSchema,
      accountId: z.string(),
      balances: AccountBalancesSchema,
    });
    export type GetAccountStateResponse = z.infer<typeof GetAccountStateResponseSchema>;
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains critical behavioral traits: balance amounts are returned in smallest units, mandatory conversion steps are required, common errors to avoid, and specific formatting requirements. This goes far beyond basic functionality.

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

Conciseness3/5

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

The description is appropriately front-loaded with the core purpose, but becomes verbose with detailed conversion instructions. While all content is valuable, it could be more structured with bullet points or sections rather than dense paragraphs. Every sentence earns its place, but the presentation could be more efficient.

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 complexity of cryptocurrency balance handling, no annotations, and no output schema, the description provides exceptional completeness. It covers purpose, usage guidelines, behavioral requirements, conversion procedures, error examples, and integration with sibling tools. This is comprehensive for a tool with significant behavioral complexity.

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 input schema has 0% description coverage, so the description must compensate. While it doesn't explicitly define chainId and accountId parameters, it provides rich contextual information about how these parameters relate to conversion steps (e.g., chainId is used in listFeatures and getTokenDetails calls). The description adds significant value beyond the bare 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 tool's purpose with specific verbs and resources: 'Get the state of an account (balances and staking positions).' It distinguishes from siblings like getAccountHistory (which retrieves historical data) and getTokenDetails (which focuses on token metadata).

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

Usage Guidelines5/5

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

The description provides explicit usage guidance by mandating conversion steps and referencing sibling tools: 'MUST call listFeatures(chainId) first' and 'MUST call getTokenDetails(chainId, tokenId) for each token.' It also warns against common errors, clearly defining when and how to use this tool versus alternatives.

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/AdamikHQ/adamik-mcp-server'

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