relay_transactions_single
Index specific transfers, wraps, and unwraps from a single transaction by submitting a request ID, chain ID, and transaction hash.
Instructions
Notify the Relay backend to index transfers, wraps and unwraps for a specific transaction.
When to use: • Index specific transfers within a transaction • Track wrap/unwrap operations • Associate transaction data with a request ID
Difference from relay_transactions_index: • This is for indexing specific transfers/wraps/unwraps • relay_transactions_index is for general transaction tracking
Required: requestId, chainId (string), tx (transaction hash)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | Request ID to associate with the transaction | |
| chainId | Yes | Chain ID where the transaction occurred (as string, e.g., "1" for Ethereum, "10" for Optimism) | |
| tx | Yes | Transaction hash to index (0x...) |
Implementation Reference
- src/tools/transactions.ts:183-186 (handler)The handler function for relay_transactions_single tool. It parses args with the schema and calls client.indexTransactionSingle(params).
handler: async (args: unknown) => { const params = transactionSingleSchema.parse(args); return await client.indexTransactionSingle(params); }, - src/tools/transactions.ts:28-32 (schema)Zod schema (transactionSingleSchema) for validating single transaction indexing parameters: requestId, chainId, and tx.
const transactionSingleSchema = z.object({ requestId: z.string().describe('Request ID to associate with the transaction'), chainId: z.string().describe('Chain ID where the transaction occurred'), tx: z.string().describe('Transaction hash or transaction data'), }); - src/tools/transactions.ts:153-187 (registration)The tool registration block for relay_transactions_single, defining name, description, inputSchema, and the handler.
relay_transactions_single: { name: 'relay_transactions_single', description: 'Notify the Relay backend to index transfers, wraps and unwraps for a specific transaction.\n\nWhen to use:\n• Index specific transfers within a transaction\n• Track wrap/unwrap operations\n• Associate transaction data with a request ID\n\nDifference from relay_transactions_index:\n• This is for indexing specific transfers/wraps/unwraps\n• relay_transactions_index is for general transaction tracking\n\nRequired: requestId, chainId (string), tx (transaction hash)', inputSchema: { type: 'object', properties: { requestId: { type: 'string', description: 'Request ID to associate with the transaction' }, chainId: { type: 'string', description: 'Chain ID where the transaction occurred (as string, e.g., "1" for Ethereum, "10" for Optimism)' }, tx: { type: 'string', description: 'Transaction hash to index (0x...)' } }, required: ['requestId', 'chainId', 'tx'], additionalProperties: false }, /** * Handler function for the relay_transactions_single tool. * * @param {unknown} args - Raw arguments from MCP client * @returns {Promise<{message: string}>} Confirmation message from the backend * @throws {ZodError} When arguments don't match the expected schema * @throws {RelayAPIError} When transaction data is invalid or backend error occurs */ handler: async (args: unknown) => { const params = transactionSingleSchema.parse(args); return await client.indexTransactionSingle(params); }, }, - src/client/RelayClient.ts:336-339 (handler)The RelayClient.indexTransactionSingle method that makes the actual POST /transactions/single API call.
async indexTransactionSingle(request: TransactionSingleRequest): Promise<{ message: string }> { const response = await this.client.post<{ message: string }>('/transactions/single', request); return response.data; } - src/types/relay.ts:473-480 (schema)TypeScript interface TransactionSingleRequest defining the shape of the request object (requestId, chainId, tx).
export interface TransactionSingleRequest { /** Request ID to associate with the transaction */ requestId: string; /** Chain ID where the transaction occurred */ chainId: string; /** Transaction hash */ tx: string; }