getTransactionDetails
Retrieve detailed information about a blockchain transaction by providing the chain ID and transactionID. Part of the Adamik MCP Server for multi-chain data queries and management.
Instructions
Gets info about a transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | ||
| transactionId | Yes |
Implementation Reference
- src/module.ts:413-428 (handler)The handler function that executes the tool logic: fetches transaction details from the Adamik API using makeApiRequest and returns the JSON response.async ({ chainId, transactionId }: GetTransactionDetailsPathParams) => { const transaction = await makeApiRequest<GetTransactionDetailsResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/transaction/${transactionId}`, ADAMIK_API_KEY ); const text = JSON.stringify(transaction); return { content: [ { type: "text", text, }, ], }; }
- src/module.ts:406-429 (registration)Registration of the getTransactionDetails tool on the MCP server, specifying name, description, input parameters schema, and the handler function.server.tool( "getTransactionDetails", "Gets info about a transaction", { chainId: ChainIdSchema, transactionId: z.string(), }, async ({ chainId, transactionId }: GetTransactionDetailsPathParams) => { const transaction = await makeApiRequest<GetTransactionDetailsResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/transaction/${transactionId}`, ADAMIK_API_KEY ); const text = JSON.stringify(transaction); return { content: [ { type: "text", text, }, ], }; } );
- src/schemas.ts:240-244 (schema)Zod schema definition for the path parameters (chainId and transactionId) used in the getTransactionDetails tool.export const GetTransactionDetailsPathParamsSchema = z.object({ chainId: ChainIdSchema, transactionId: z.string(), }); export type GetTransactionDetailsPathParams = z.infer<typeof GetTransactionDetailsPathParamsSchema>;
- src/schemas.ts:246-250 (schema)Zod schema definition for the response type of getTransactionDetails, including transaction details and status.export const GetTransactionDetailsResponseSchema = z.object({ transaction: TransactionDetailSchema, status: TransactionStatusSchema, }); export type GetTransactionDetailsResponse = z.infer<typeof GetTransactionDetailsResponseSchema>;