Skip to main content
Glama

read.account.history

Read-onlyIdempotent

Retrieve historical collateral, debt, and net value snapshots for an Arcadia account in USD over a specified period. Use to chart account performance.

Instructions

Get historical collateral and debt values for an Arcadia account over time. Returns a time series of snapshots (timestamp, collateral_value, debt_value, net_value). Each value is the account's net value in USD (human-readable, not raw units). Useful for charting account performance over a period.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_addressYesArcadia account address
daysNoNumber of days of history (default 14)
chain_idNoChain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
historyYes

Implementation Reference

  • Registration of the 'read.account.history' tool with MCP server, including annotations, description, inputSchema, outputSchema, and the handler callback
    server.registerTool(
      "read.account.history",
      {
        annotations: {
          title: "Get Account History",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
        description:
          "Get historical collateral and debt values for an Arcadia account over time. Returns a time series of snapshots (timestamp, collateral_value, debt_value, net_value). Each value is the account's net value in USD (human-readable, not raw units). Useful for charting account performance over a period.",
        inputSchema: {
          account_address: z.string().describe("Arcadia account address"),
          days: z.number().default(14).describe("Number of days of history (default 14)"),
          chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
        },
        outputSchema: AccountHistoryOutput,
      },
      async ({ account_address, days, chain_id }) => {
        try {
          const validChainId = validateChainId(chain_id);
          if (days <= 0) {
            return {
              content: [{ type: "text" as const, text: "Error: days must be a positive number" }],
              isError: true,
            };
          }
          const raw = await api.getAccountHistory(validChainId, account_address, days);
          const result = { history: Array.isArray(raw) ? raw : [] };
          return {
            content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            structuredContent: result,
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error: ${err instanceof Error ? err.message : String(err)}`,
              },
            ],
            isError: true,
          };
        }
      },
    );
  • Handler function for read.account.history: validates chainId, checks days > 0, calls api.getAccountHistory(), and returns the result as { history: [...] }
      async ({ account_address, days, chain_id }) => {
        try {
          const validChainId = validateChainId(chain_id);
          if (days <= 0) {
            return {
              content: [{ type: "text" as const, text: "Error: days must be a positive number" }],
              isError: true,
            };
          }
          const raw = await api.getAccountHistory(validChainId, account_address, days);
          const result = { history: Array.isArray(raw) ? raw : [] };
          return {
            content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            structuredContent: result,
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error: ${err instanceof Error ? err.message : String(err)}`,
              },
            ],
            isError: true,
          };
        }
      },
    );
  • Output schema (AccountHistoryOutput) defining that the response contains an array of history records
    export const AccountHistoryOutput = z.object({
      history: z.array(z.record(z.unknown())),
    });
  • API client method getAccountHistory() that calls the external API endpoint /accounts/historic_account_values with chain_id, account_address, start, and end timestamps
    async getAccountHistory(chainId: number, account: string, days = 14) {
      const end = Math.floor(Date.now() / 1000);
      const start = end - days * 86400;
      return this.get("/accounts/historic_account_values", {
        chain_id: chainId,
        account_address: account,
        start,
        end,
      });
    }
Behavior5/5

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

Annotations already indicate safe, idempotent read. The description adds value by specifying that returned values are in human-readable USD and are net values, providing behavioral context beyond the annotations.

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 two sentences, front-loaded with purpose and output, and includes a concrete usage hint. Every sentence adds value without redundancy.

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 existence of an output schema, the description adequately covers purpose, parameters, and behavioral hints. It provides all needed context for a simple historical data retrieval tool.

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 coverage is 100%, so the schema already describes all parameters. The description only implicitly references 'days' via 'over a period', adding no new meaning to the parameters.

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 action ('Get historical collateral and debt values'), the resource ('Arcadia account'), and the output format ('time series of snapshots'). It distinguishes from siblings like 'read.account.info' by focusing on historical values over time.

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 includes a use case ('Useful for charting account performance over a period'), which implicitly suggests when to use the tool. However, it does not explicitly mention when not to use it or compare against alternatives like 'read.account.pnl' or 'read.account.info'.

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

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