Skip to main content
Glama
jun229

truemarkets-mcp-server

by jun229

tm_prepare_transfer

Prepare cryptocurrency transfers to external wallets by specifying destination address, token, amount, and blockchain. Generates transfer details and ID for subsequent execution.

Instructions

Prepare a transfer to an external wallet address. Returns transfer details and a transfer_id for execution with tm_execute_transfer.

Args:

  • to (string): Destination wallet address

  • token (string): Token symbol or contract address

  • amount (string): Quantity as decimal string

  • chain ("solana" | "base"): Chain (default: solana)

  • qty_unit ("base" | "quote"): Amount unit (default: base)

Returns: { transfer_id, to, token, amount, chain }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesDestination wallet address
tokenYesToken symbol or address
amountYesAmount to transfer
chainNosolana
qty_unitNobase

Implementation Reference

  • Handler implementation for tm_prepare_transfer which resolves assets and calls the API to prepare a transfer.
      async ({ to, token, amount, chain, qty_unit }) => {
        let asset = token;
        let resolvedChain = chain;
    
        if (isSymbol(token)) {
          const assets = await api.getAssets();
          const match = assets.find(
            (a) => a.symbol?.toLowerCase() === token.toLowerCase()
          );
          if (!match?.address) {
            return {
              isError: true,
              content: [{ type: "text", text: `Could not resolve symbol "${token}".` }],
            };
          }
          asset = match.address;
          if (match.chain) resolvedChain = match.chain.toLowerCase() as "solana" | "base";
        }
    
        const resp = await api.prepareTransfer({
          chain: resolvedChain,
          asset,
          to,
          qty: amount,
          qty_unit,
        });
    
        const output = {
          transfer_id: resp.transfer_id ?? null,
          to,
          token: token.toUpperCase(),
          amount,
          chain: resolvedChain,
          has_payloads: !!(resp.payloads && resp.payloads.length > 0),
        };
    
        return {
          content: [{ type: "text", text: JSON.stringify(output, null, 2) }],
          structuredContent: output,
        };
      }
    );
  • Registration of the tm_prepare_transfer tool, including its input schema and description.
      server.registerTool(
        "tm_prepare_transfer",
        {
          title: "Prepare a token transfer",
          description: `Prepare a transfer to an external wallet address. Returns transfer
    details and a transfer_id for execution with tm_execute_transfer.
    
    Args:
      - to (string): Destination wallet address
      - token (string): Token symbol or contract address
      - amount (string): Quantity as decimal string
      - chain ("solana" | "base"): Chain (default: solana)
      - qty_unit ("base" | "quote"): Amount unit (default: base)
    
    Returns: { transfer_id, to, token, amount, chain }`,
          inputSchema: {
            to: z.string().describe("Destination wallet address"),
            token: z.string().describe("Token symbol or address"),
            amount: z.string().describe("Amount to transfer"),
            chain: z.enum(["solana", "base"]).default("solana"),
            qty_unit: z.enum(["base", "quote"]).default("base"),
          },
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: true,
          },
        },

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/jun229/tm-mcp-server'

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