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
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | ||
| chainId | Yes |
Implementation Reference
- src/module.ts:363-379 (handler)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, }, ], }; } );
- src/schemas.ts:349-367 (schema)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>;