relay_transactions_index
Notify Relay backend of a transaction to enable cross-chain tracking and status monitoring. Provide transaction hash and chain ID after sending a deposit transaction for proper request linking.
Instructions
Notify the Relay backend about a transaction. This is used to index and track transactions for cross-chain operations.
When to use: • After executing a transaction from a quote response • When you want Relay to track a specific transaction • For proper status monitoring and request linking
Example: After sending the deposit transaction from relay_get_quote response, call this tool with the transaction hash and chain ID to enable proper tracking.
Required: txHash (0x...), chainId (number) Optional: requestId (from quote response for linking)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txHash | Yes | Transaction hash to index | |
| chainId | Yes | Chain ID where the transaction occurred (as string, e.g., "1" for Ethereum, "10" for Optimism) | |
| requestId | No | Optional request ID to associate with the transaction |
Implementation Reference
- src/tools/transactions.ts:122-125 (handler)The handler function for relay_transactions_index. It validates arguments with the Zod schema and calls client.indexTransaction() to notify the Relay backend.
handler: async (args: unknown) => { const params = transactionIndexSchema.parse(args); return await client.indexTransaction(params); }, - src/tools/transactions.ts:18-22 (schema)Zod input validation schema for relay_transactions_index, defining required txHash, chainId, and optional requestId fields.
const transactionIndexSchema = z.object({ txHash: z.string().describe('Transaction hash to index'), chainId: z.string().describe('Chain ID where the transaction occurred'), requestId: z.string().optional().describe('Optional request ID to associate with the transaction'), }); - src/tools/transactions.ts:95-112 (schema)The JSON Schema input schema (inputSchema) for MCP tool registration, defining the expected parameters.
inputSchema: { type: 'object', properties: { txHash: { type: 'string', description: 'Transaction hash to index' }, chainId: { type: 'string', description: 'Chain ID where the transaction occurred (as string, e.g., "1" for Ethereum, "10" for Optimism)' }, requestId: { type: 'string', description: 'Optional request ID to associate with the transaction' } }, required: ['txHash', 'chainId'], additionalProperties: false - src/tools/transactions.ts:92-93 (registration)Registration of the relay_transactions_index tool within the createTransactionTools function, defining its name and description.
relay_transactions_index: { name: 'relay_transactions_index', - src/client/RelayClient.ts:308-311 (helper)The RelayClient helper method that makes the actual API POST request to /transactions/index endpoint.
async indexTransaction(request: TransactionIndexRequest): Promise<{ message: string }> { const response = await this.client.post<{ message: string }>('/transactions/index', request); return response.data; }