Skip to main content
Glama
warengonzaga

Relay Protocol MCP Server

by warengonzaga

relay_get_requests

Retrieve cross-chain transactions with filters for user, hash, chain IDs, time range, status, and referrer. Includes pagination and sorting by date. Monitor transaction history efficiently.

Instructions

Get all cross-chain transactions with advanced filtering and pagination.

Use Cases: • List all transactions for a specific user • Find transactions by hash, chain IDs, or time range • Monitor transaction history with pagination • Filter by request status and referrer

Pagination: Use limit (max 50) and continuation token for large result sets. Sorting: Sort by createdAt or updatedAt in asc/desc order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoLimit the number of results (1-50, default: 20)
continuationNoContinuation token for pagination
userNoFilter by user address
hashNoFilter by transaction hash
originChainIdNoFilter by origin chain ID
destinationChainIdNoFilter by destination chain ID
privateChainsToIncludeNoPrivate chains to include
idNoFilter by request ID
startTimestampNoStart timestamp filter (Unix timestamp)
endTimestampNoEnd timestamp filter (Unix timestamp)
startBlockNoStart block filter
endBlockNoEnd block filter
chainIdNoFilter by chain ID (either direction, overrides origin/destination filters)
referrerNoFilter by referrer address
sortByNoSort field (default: createdAt)
sortDirectionNoSort direction

Implementation Reference

  • Handler function for the relay_get_requests tool. Parses args using getRequestsSchema (Zod) and calls client.getRequests(params) to fetch paginated cross-chain requests.
      handler: async (args: unknown) => {
        const params = getRequestsSchema.parse(args);
        return await client.getRequests(params);
      },
    },
  • Zod schema for relay_get_requests input validation. Defines all filter/pagination fields (limit, continuation, user, hash, chainIds, timestamps, blocks, referrer, sort options).
    const getRequestsSchema = z.object({
      limit: z.number().min(1).max(50).optional().describe('Limit the number of results (1-50, default: 20)'),
      continuation: z.string().optional().describe('Continuation token for pagination'),
      user: z.string().optional().describe('Filter by user address'),
      hash: z.string().optional().describe('Filter by transaction hash'),
      originChainId: z.number().optional().describe('Filter by origin chain ID'),
      destinationChainId: z.number().optional().describe('Filter by destination chain ID'),
      privateChainsToInclude: z.string().optional().describe('Private chains to include'),
      id: z.string().optional().describe('Filter by request ID'),
      startTimestamp: z.number().optional().describe('Start timestamp filter'),
      endTimestamp: z.number().optional().describe('End timestamp filter'),
      startBlock: z.number().optional().describe('Start block filter'),
      endBlock: z.number().optional().describe('End block filter'),
      chainId: z.string().optional().describe('Filter by chain ID (either direction)'),
      referrer: z.string().optional().describe('Filter by referrer'),
      sortBy: z.enum(['createdAt', 'updatedAt']).optional().describe('Sort field'),
      sortDirection: z.enum(['asc', 'desc']).optional().describe('Sort direction'),
    });
  • Registration of the relay_get_requests tool within createRequestTools(). Defines name, description, inputSchema (JSON Schema format), and the handler function.
    relay_get_requests: {
      name: 'relay_get_requests',
      description: 'Get all cross-chain transactions with advanced filtering and pagination.\n\nUse Cases:\n• List all transactions for a specific user\n• Find transactions by hash, chain IDs, or time range\n• Monitor transaction history with pagination\n• Filter by request status and referrer\n\nPagination: Use limit (max 50) and continuation token for large result sets.\nSorting: Sort by createdAt or updatedAt in asc/desc order.',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            minimum: 1,
            maximum: 50,
            description: 'Limit the number of results (1-50, default: 20)'
          },
          continuation: {
            type: 'string',
            description: 'Continuation token for pagination'
          },
          user: {
            type: 'string',
            description: 'Filter by user address'
          },
          hash: {
            type: 'string',
            description: 'Filter by transaction hash'
          },
          originChainId: {
            type: 'number',
            description: 'Filter by origin chain ID'
          },
          destinationChainId: {
            type: 'number',
            description: 'Filter by destination chain ID'
          },
          privateChainsToInclude: {
            type: 'string',
            description: 'Private chains to include'
          },
          id: {
            type: 'string',
            description: 'Filter by request ID'
          },
          startTimestamp: {
            type: 'number',
            description: 'Start timestamp filter (Unix timestamp)'
          },
          endTimestamp: {
            type: 'number',
            description: 'End timestamp filter (Unix timestamp)'
          },
          startBlock: {
            type: 'number',
            description: 'Start block filter'
          },
          endBlock: {
            type: 'number',
            description: 'End block filter'
          },
          chainId: {
            type: 'string',
            description: 'Filter by chain ID (either direction, overrides origin/destination filters)'
          },
          referrer: {
            type: 'string',
            description: 'Filter by referrer address'
          },
          sortBy: {
            type: 'string',
            enum: ['createdAt', 'updatedAt'],
            description: 'Sort field (default: createdAt)'
          },
          sortDirection: {
            type: 'string',
            enum: ['asc', 'desc'],
            description: 'Sort direction'
          }
        },
        additionalProperties: false
      },
      /**
       * Handler function for the relay_get_requests tool.
       * 
       * @param {unknown} args - Raw arguments from MCP client
       * @returns {Promise<GetRequestsResponse>} Paginated list of cross-chain requests
       * @throws {ZodError} When arguments don't match the expected schema
       * @throws {RelayAPIError} When filter parameters are invalid
       */
      handler: async (args: unknown) => {
        const params = getRequestsSchema.parse(args);
        return await client.getRequests(params);
      },
    },
  • Client method getRequests() - makes the actual HTTP GET request to /requests/v2 endpoint with filter/pagination params and returns the response data.
    async getRequests(request: GetRequestsRequest = {}): Promise<GetRequestsResponse> {
      const response = await this.client.get<GetRequestsResponse>('/requests/v2', {
        params: request
      });
      return response.data;
    }
  • TypeScript interfaces GetRequestsRequest and GetRequestsResponse defining the request filter parameters and response structure for the API call.
    export interface GetRequestsRequest {
      /** Maximum number of requests to return */
      limit?: number;
      /** Pagination token for next page */
      continuation?: string;
      /** Filter by user address */
      user?: string;
      /** Filter by transaction hash */
      hash?: string;
      /** Filter by origin chain ID */
      originChainId?: number;
      /** Filter by destination chain ID */
      destinationChainId?: number;
      /** Include private chains in results */
      privateChainsToInclude?: string;
      /** Filter by request ID */
      id?: string;
      /** Filter by start timestamp */
      startTimestamp?: number;
      /** Filter by end timestamp */
      endTimestamp?: number;
      /** Filter by start block number */
      startBlock?: number;
      /** Filter by end block number */
      endBlock?: number;
      /** Filter by chain ID */
      chainId?: string;
      /** Filter by referrer address */
      referrer?: string;
      /** Sort field */
      sortBy?: 'createdAt' | 'updatedAt';
      /** Sort direction */
      sortDirection?: 'asc' | 'desc';
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses pagination behavior, sorting options, and filtering capabilities. Does not mention side effects (expected read-only) or authentication, but adequate for a query tool.

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

Conciseness5/5

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

Description is highly concise with front-loaded purpose, followed by bullet-pointed use cases and clear pagination/sorting notes. Every sentence adds value.

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?

For a tool with 16 parameters and no output schema, the description covers main use cases, pagination, and sorting. It does not detail return format, but schema descriptions fill in parameter details. Sufficient for an agent to select and invoke.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. Description adds grouping of use cases and mention of pagination/sorting, but does not provide additional meaning for individual parameters beyond what the schema already describes.

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?

Description clearly states 'Get all cross-chain transactions with advanced filtering and pagination,' providing specific verb and resource. Use cases differentiate it from sibling tools like relay_get_chains and relay_get_currencies.

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

Usage Guidelines4/5

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

Use cases are listed explicitly (listing for user, finding by hash, monitoring history, filtering by status). Pagination and sorting are mentioned. However, no guidance on when not to use or comparisons to alternatives.

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/warengonzaga/relay-protocol-mcp-server'

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