Skip to main content
Glama
RWAValueRouter

ValueRouter MCP Server

execute_bridge

Simulate cross-chain USDC transfers between blockchain networks to generate transaction data for bridging operations.

Instructions

Execute a bridge transaction (simulation only - returns transaction data)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromChainIdYesSource chain ID
toChainIdYesDestination chain ID
fromTokenYes
toTokenYes
amountYesAmount to bridge in smallest unit
recipientAddressYesRecipient address on destination chain
userAddressYesUser address initiating the transaction
slippageBpsNoSlippage tolerance in basis points
memoNoMemo for Cosmos chains (optional)

Implementation Reference

  • The primary handler for the 'execute_bridge' tool. Parses input arguments using BridgeRequestSchema, delegates to BridgeService for transaction preparation, adds simulation warning, and returns MCPToolResult.
    private async executeBridge(args: any): Promise<MCPToolResult> {
      try {
        const request = BridgeRequestSchema.parse(args);
        const result = await this.bridgeService.prepareBridgeTransaction(request);
        
        // Add a warning that this is simulation only
        return createSuccessResponse({
          ...result,
          warning: 'This is a simulation only. To execute the transaction, use the returned transaction data with your wallet.',
          simulationOnly: true,
        });
      } catch (error) {
        return createErrorResponse(
          error instanceof Error ? error.message : String(error),
          'BRIDGE_ERROR'
        );
      }
    }
  • src/index.ts:164-235 (registration)
    Registration of the 'execute_bridge' tool in the ListToolsRequestSchema handler, including detailed input schema definition.
    {
      name: 'execute_bridge',
      description: 'Execute a bridge transaction (simulation only - returns transaction data)',
      inputSchema: {
        type: 'object',
        properties: {
          fromChainId: {
            oneOf: [
              { type: 'number' },
              { type: 'string' },
            ],
            description: 'Source chain ID',
          },
          toChainId: {
            oneOf: [
              { type: 'number' },
              { type: 'string' },
            ],
            description: 'Destination chain ID',
          },
          fromToken: {
            type: 'object',
            properties: {
              address: { type: 'string' },
              chainId: { oneOf: [{ type: 'number' }, { type: 'string' }] },
              symbol: { type: 'string' },
              name: { type: 'string' },
              decimals: { type: 'number' },
              logoURI: { type: 'string' },
              isNative: { type: 'boolean' },
            },
            required: ['address', 'chainId', 'symbol', 'name', 'decimals'],
          },
          toToken: {
            type: 'object',
            properties: {
              address: { type: 'string' },
              chainId: { oneOf: [{ type: 'number' }, { type: 'string' }] },
              symbol: { type: 'string' },
              name: { type: 'string' },
              decimals: { type: 'number' },
              logoURI: { type: 'string' },
              isNative: { type: 'boolean' },
            },
            required: ['address', 'chainId', 'symbol', 'name', 'decimals'],
          },
          amount: {
            type: 'string',
            description: 'Amount to bridge in smallest unit',
          },
          recipientAddress: {
            type: 'string',
            description: 'Recipient address on destination chain',
          },
          userAddress: {
            type: 'string',
            description: 'User address initiating the transaction',
          },
          slippageBps: {
            type: 'number',
            description: 'Slippage tolerance in basis points',
            default: 100,
          },
          memo: {
            type: 'string',
            description: 'Memo for Cosmos chains (optional)',
          },
        },
        required: ['fromChainId', 'toChainId', 'fromToken', 'toToken', 'amount', 'recipientAddress', 'userAddress'],
        additionalProperties: false,
      },
    },
  • Zod schema (BridgeRequestSchema) used for input validation in the execute_bridge handler.
    export const BridgeRequestSchema = z.object({
      fromChainId: z.union([z.number(), z.string()]),
      toChainId: z.union([z.number(), z.string()]),
      fromToken: TokenSchema,
      toToken: TokenSchema,
      amount: z.string(),
      recipientAddress: z.string(),
      slippageBps: z.number().optional().default(100),
      userAddress: z.string(),
      memo: z.string().optional(), // For Cosmos chains
    });
  • src/index.ts:339-340 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes 'execute_bridge' calls to the executeBridge method.
    case 'execute_bridge':
      return await this.executeBridge(args);
  • Core helper method in BridgeService that handles the bridge transaction preparation logic, dispatching to chain-specific implementations (simulation-based). Called by the main handler.
    async prepareBridgeTransaction(request: BridgeRequest): Promise<BridgeResponse> {
      const { fromChainId, toChainId, fromToken, toToken, amount, recipientAddress, userAddress } = request;
    
      // Cast chain IDs to proper types
      const fromChainIdTyped = fromChainId as SupportedChainId;
      const toChainIdTyped = toChainId as SupportedChainId;
    
      // Validate chain support
      if (!CHAIN_INFO[fromChainIdTyped] || !CHAIN_INFO[toChainIdTyped]) {
        throw new Error(`Unsupported chain: ${fromChainId} or ${toChainId}`);
      }
    
      // Validate USDC bridging (for now, we focus on USDC)
      if (fromToken.symbol !== 'USDC' && toToken.symbol !== 'USDC') {
        throw new Error('Currently only USDC bridging is supported');
      }
    
      try {
        if (isEVMChain(fromChainIdTyped)) {
          return await this.prepareEVMBridge(request);
        } else if (isSolanaChain(fromChainIdTyped)) {
          return await this.prepareSolanaBridge(request);
        } else if (isSuiChain(fromChainIdTyped)) {
          return await this.prepareSuiBridge(request);
        } else if (isCosmosChain(fromChainIdTyped)) {
          return await this.prepareCosmosBridge(request);
        } else {
          throw new Error(`Unsupported source chain: ${fromChainId}`);
        }
      } catch (error) {
        throw new Error(`Failed to prepare bridge transaction: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/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. While it reveals this is a simulation that returns transaction data (not executing real transactions), it doesn't address important behavioral aspects: whether this requires authentication, rate limits, what specific data is returned, error conditions, or how the simulation differs from actual execution. For a complex 9-parameter tool with no annotations, this is insufficient.

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?

The description is extremely concise - a single sentence with parenthetical clarification. Every word earns its place: 'Execute a bridge transaction' establishes the core action, while '(simulation only - returns transaction data)' provides critical behavioral context. There's zero redundancy or unnecessary elaboration.

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

Completeness2/5

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

For a complex bridge transaction tool with 9 parameters (including nested objects), no annotations, and no output schema, the description is inadequate. It doesn't explain what 'transaction data' is returned, how the simulation works, error handling, or the relationship between this tool and its siblings. The agent would struggle to use this tool effectively without significant trial and error.

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 78% (high), establishing a baseline of 3. The description adds no parameter-specific information beyond what's in the schema. While the schema documents parameters well, the description doesn't provide additional context about parameter relationships, validation rules, or usage patterns that would help an agent understand how to properly construct requests.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Execute a bridge transaction' with the important qualifier '(simulation only - returns transaction data)'. This distinguishes it from actual execution tools and indicates it's for testing/analysis. However, it doesn't explicitly differentiate from sibling tools like 'estimate_bridge_fees' or 'get_bridge_quote' which might also involve simulation aspects.

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

Usage Guidelines3/5

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

The description implies usage context through 'simulation only', suggesting this should be used for testing rather than real transactions. However, it provides no explicit guidance on when to choose this tool versus alternatives like 'estimate_bridge_fees' or 'get_bridge_quote', nor does it mention prerequisites or when-not-to-use scenarios beyond the simulation aspect.

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/RWAValueRouter/MCP'

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