Skip to main content
Glama

getAccountHistory

Retrieve transaction history for a specific account on any supported blockchain network. Use chainId and accountId to access detailed records via a standardized multi-chain API.

Instructions

Get the transaction history for an account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYes
chainIdYes

Implementation Reference

  • The handler function for getAccountHistory tool that fetches account transaction history from Adamik API and returns it as JSON text content.
    async ({ chainId, accountId, nextPage }: GetAccountHistoryPathParams & GetAccountHistoryQueryParams) => { const history = await makeApiRequest<GetAccountHistoryResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/account/${accountId}/history${ nextPage ? `?nextPage=${nextPage}` : "" }`, ADAMIK_API_KEY ); const text = JSON.stringify(history); return { content: [ { type: "text", text, }, ], }; }
  • src/module.ts:356-380 (registration)
    Registers the getAccountHistory tool with the MCP server using server.tool(), including description, path parameters schema, and handler reference.
    server.tool( "getAccountHistory", "Get the transaction history for an account", { chainId: ChainIdSchema, accountId: z.string(), }, async ({ chainId, accountId, nextPage }: GetAccountHistoryPathParams & GetAccountHistoryQueryParams) => { const history = await makeApiRequest<GetAccountHistoryResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/account/${accountId}/history${ nextPage ? `?nextPage=${nextPage}` : "" }`, ADAMIK_API_KEY ); const text = JSON.stringify(history); return { content: [ { type: "text", text, }, ], }; } );
  • Zod schemas defining input path parameters, query parameters, and response structure for the getAccountHistory tool.
    export const GetAccountHistoryPathParamsSchema = z.object({ chainId: ChainIdSchema, accountId: z.string(), }); export type GetAccountHistoryPathParams = z.infer<typeof GetAccountHistoryPathParamsSchema>; export const GetAccountHistoryQueryParamsSchema = z.object({ nextPage: z.string().optional(), include: z.string().optional(), }); export type GetAccountHistoryQueryParams = z.infer<typeof GetAccountHistoryQueryParamsSchema>; export const GetAccountHistoryResponseSchema = z.object({ chainId: ChainIdSchema, accountId: z.string(), transactions: z.array(TransactionDetailSchema), pagination: PaginationSchema, }); export type GetAccountHistoryResponse = z.infer<typeof GetAccountHistoryResponseSchema>;

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