Skip to main content
Glama

get_transaction_status

Check the status of a cross-chain bridge or swap transaction using the request ID from execute_bridge. Monitor progress from waiting to success, failure, or refund.

Instructions

Check the status of a Relay bridge or swap transaction. Use the requestId returned from execute_bridge.

Statuses: waiting — The origin chain transaction has been broadcast but not yet confirmed on-chain. Just wait — no further action needed. pending — The relay network has picked up the request and is processing the cross-chain transfer. success — Complete. Funds have arrived on the destination chain. failure — The transaction failed. refund — The transaction was refunded to the sender.

IMPORTANT: After the wallet "execute" action completes all steps (approval + deposit), Relay handles the cross-chain delivery automatically. Poll every 5-10 seconds until success or failure. The user does NOT need to do anything else after execution completes — just wait.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYesThe request ID returned from execute_bridge or from a quote's steps[].requestId.

Implementation Reference

  • The main handler implementation that registers the 'get_transaction_status' MCP tool, including its schema definition (requestId parameter) and the async handler function that calls getIntentStatus, formats status messages based on the response, and returns both a human-readable summary and the raw status data.
    export function register(server: McpServer) {
      server.tool(
        "get_transaction_status",
        `Check the status of a Relay bridge or swap transaction. Use the requestId returned from execute_bridge.
    
    Statuses:
      waiting  — The origin chain transaction has been broadcast but not yet confirmed on-chain. Just wait — no further action needed.
      pending  — The relay network has picked up the request and is processing the cross-chain transfer.
      success  — Complete. Funds have arrived on the destination chain.
      failure  — The transaction failed.
      refund   — The transaction was refunded to the sender.
    
    IMPORTANT: After the wallet "execute" action completes all steps (approval + deposit), Relay handles the cross-chain delivery automatically. Poll every 5-10 seconds until success or failure. The user does NOT need to do anything else after execution completes — just wait.`,
        {
          requestId: z
            .string()
            .describe(
              "The request ID returned from execute_bridge or from a quote's steps[].requestId."
            ),
        },
        async ({ requestId }) => {
          const status = await getIntentStatus(requestId);
    
          const trackingUrl = `https://relay.link/transaction/${requestId}`;
    
          let summary: string;
          switch (status.status) {
            case "success":
              summary = `Transaction complete! Destination tx: ${status.txHashes?.join(", ") || "pending confirmation"}.\n\nView on Relay: ${trackingUrl}`;
              break;
            case "pending":
              summary = "Transaction is being processed by the relay network.";
              break;
            case "waiting":
              summary = "Transaction submitted, waiting to be picked up by the relay network.";
              break;
            case "failure":
              summary = "Transaction failed. Check the requestId and try again.";
              break;
            case "refund":
              summary = "Transaction was refunded to the sender.";
              break;
            default:
              summary = `Transaction status: ${status.status}.`;
          }
    
          return {
            content: [
              { type: "text", text: summary },
              { type: "text", text: JSON.stringify(status, null, 2) },
            ],
          };
        }
      );
    }
  • src/index.ts:10-26 (registration)
    Tool registration: imports the register function from get-transaction-status.ts and calls it with the MCP server instance to enable the tool.
    import { register as registerGetTransactionStatus } from "./tools/get-transaction-status.js";
    import { register as registerGetTransactionHistory } from "./tools/get-transaction-history.js";
    import { register as registerGetRelayAppUrl } from "./tools/get-relay-app-url.js";
    import { register as registerWallet } from "./tools/wallet.js";
    
    const server = new McpServer({
      name: "relay-mcp",
      version: "0.1.0",
    });
    
    registerGetSupportedChains(server);
    registerGetSupportedTokens(server);
    registerGetBridgeQuote(server);
    registerGetSwapQuote(server);
    registerEstimateFees(server);
    registerExecuteBridge(server);
    registerGetTransactionStatus(server);
  • Helper function that defines the IntentStatus interface and provides getIntentStatus which makes an API call to the Relay API's /intents/status/v3 endpoint to retrieve transaction status for a given requestId.
    export interface IntentStatus {
      status: string;
      inTxHashes?: string[];
      txHashes?: string[];
      originChainId?: number;
      destinationChainId?: number;
      updatedAt?: string;
    }
    
    export async function getIntentStatus(
      requestId: string
    ): Promise<IntentStatus> {
      return relayApi<IntentStatus>("/intents/status/v3", {
        params: { requestId },
      });
    }
  • Input schema definition using Zod: defines the requestId parameter as a required string with a description of its source.
    {
      requestId: z
        .string()
        .describe(
          "The request ID returned from execute_bridge or from a quote's steps[].requestId."
        ),
    },
  • Output schema definition: TypeScript interface defining the structure of the IntentStatus response from the Relay API, including status, transaction hashes, chain IDs, and timestamp.
    export interface IntentStatus {
      status: string;
      inTxHashes?: string[];
      txHashes?: string[];
      originChainId?: number;
      destinationChainId?: number;
      updatedAt?: string;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it's a read-only status check (implied by 'Check'), discloses the possible status outcomes with explanations (waiting, pending, success, failure, refund), and provides operational context (Relay handles cross-chain delivery automatically, polling frequency). It doesn't mention rate limits or authentication needs, but covers the core behavioral aspects well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and appropriately sized. It front-loads the core purpose, then provides status details, and concludes with important usage notes. While slightly longer than minimal, every sentence adds value (status explanations, workflow context, polling advice). No redundant or wasted content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (status checking with specific outcomes), no annotations, and no output schema, the description provides strong contextual completeness. It explains the status meanings, workflow integration, and polling behavior. The main gap is lack of explicit return format details, but the status explanations partially compensate for no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds significant value beyond the schema by explaining the parameter's origin ('requestId returned from execute_bridge or from a quote's steps[].requestId') and contextualizing its use in the workflow. This enhances understanding beyond the schema's basic type information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose as 'Check the status of a Relay bridge or swap transaction' with the specific verb 'check' and resources 'Relay bridge or swap transaction'. It clearly distinguishes from siblings like get_transaction_history (which retrieves past transactions) and execute_bridge (which initiates transactions).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: it specifies when to use ('Use the requestId returned from execute_bridge'), when not to use (the user does NOT need to do anything else after execution completes), and alternatives (implied that other tools like execute_bridge or get_bridge_quote are for different purposes). It also includes polling frequency advice ('Poll every 5-10 seconds').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/relayprotocol/relay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server