Skip to main content
Glama
Logitale
by Logitale

toreador_create_session

Create a hosted payment session for ERC-20 stablecoins (USDC, USDT, EURC) on Ethereum, Polygon, or Base. Returns a payment URL for the payer to connect their wallet.

Instructions

Create a hosted payment session for ERC-20 stablecoins on EVM chains (USDC, USDT, EURC on Ethereum, Polygon or Base). Returns a session ID, a 6-character security code to display to the payer, and a URL to a Toreador-hosted payment page where the payer connects their wallet. Sessions expire 15 minutes after creation. PRO PLAN REQUIRED. For native tokens or Solana SPL, use toreador_generate_qr instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesStablecoin symbol. One of: USDC, USDT, EURC.
chainIdYesEVM chain. One of: ethereum, polygon, base.
amountYesAmount in the token's natural unit (e.g. "100" for 100 USDC).
recipientAddressYesDestination EVM wallet address (0x...).

Implementation Reference

  • src/index.ts:56-85 (registration)
    The free-tier tool definitions array; toreador_create_session is NOT in this array because it requires a Pro key. This shows the registration location context.
    const FREE_TIER_TOOLS: Tool[] = [
      {
        name: "toreador_generate_qr",
        description:
          "Generate a crypto QR code for a native token (BTC, ETH, SOL, POL) or a Solana SPL token (USDC on Solana). Returns the QR data URI (PNG base64) and the on-chain payment URI (BIP21, EIP-681, Solana Pay). FREE — no API key needed for these chains. For ERC-20 stablecoins on Ethereum/Polygon/Base (USDT, USDC, EURC), use toreador_create_session (Pro plan required).",
        inputSchema: {
          type: "object",
          properties: {
            token: {
              type: "string",
              description: "Token symbol. One of: BTC, ETH, SOL, POL, USDC (Solana only).",
            },
            chainId: {
              type: "string",
              description: "Chain identifier. One of: bitcoin, ethereum, polygon, base, solana.",
            },
            amount: {
              type: "string",
              description: "Amount as a decimal string in the token's natural unit (e.g. \"0.001\" for BTC, \"50\" for USDC). Use a string to preserve decimal precision.",
            },
            recipientAddress: {
              type: "string",
              description: "Destination wallet address. Must match the chain (bech32 for BTC, EIP-55 for EVM, base58 for Solana).",
            },
          },
          required: ["token", "chainId", "amount", "recipientAddress"],
          additionalProperties: false,
        },
      },
    ];
  • Schema definition for toreador_create_session: name, description, and inputSchema with required fields: token (USDC/USDT/EURC), chainId (ethereum/polygon/base), amount, recipientAddress.
    {
      name: "toreador_create_session",
      description:
        "Create a hosted payment session for ERC-20 stablecoins on EVM chains (USDC, USDT, EURC on Ethereum, Polygon or Base). Returns a session ID, a 6-character security code to display to the payer, and a URL to a Toreador-hosted payment page where the payer connects their wallet. Sessions expire 15 minutes after creation. PRO PLAN REQUIRED. For native tokens or Solana SPL, use toreador_generate_qr instead.",
      inputSchema: {
        type: "object",
        properties: {
          token: {
            type: "string",
            description: "Stablecoin symbol. One of: USDC, USDT, EURC.",
          },
          chainId: {
            type: "string",
            description: "EVM chain. One of: ethereum, polygon, base.",
          },
          amount: {
            type: "string",
            description: "Amount in the token's natural unit (e.g. \"100\" for 100 USDC).",
          },
          recipientAddress: {
            type: "string",
            description: "Destination EVM wallet address (0x...).",
          },
        },
        required: ["token", "chainId", "amount", "recipientAddress"],
        additionalProperties: false,
      },
    },
  • Handler: the callTool switch dispatches 'toreador_create_session' to a POST /create-session request with token, chainId, amount, recipientAddress via the toreadorRequest helper.
    case "toreador_create_session":
      return toreadorRequest("POST", "/create-session", {
        token: args.token,
        chainId: args.chainId,
        amount: args.amount,
        recipientAddress: args.recipientAddress,
      });
  • toreadorRequest is the shared HTTP helper used by the handler. It constructs the URL, adds X-API-Key header, sets a timeout, and returns ok/status/data.
    async function toreadorRequest(
      method: "GET" | "POST",
      path: string,
      body?: unknown,
    ): Promise<{ ok: boolean; status: number; data: unknown }> {
      const url = `${TOREADOR_BASE_URL}${path}`;
      const headers: Record<string, string> = {
        "Accept": "application/json",
        "User-Agent": "toreador-mcp-server/0.2.0",
      };
      if (TOREADOR_API_KEY) headers["X-API-Key"] = TOREADOR_API_KEY;
      const init: RequestInit = { method, headers };
      if (body !== undefined) {
        headers["Content-Type"] = "application/json";
        init.body = JSON.stringify(body);
      }
    
      const ctrl = new AbortController();
      const timer = setTimeout(() => ctrl.abort(), REQUEST_TIMEOUT_MS);
      init.signal = ctrl.signal;
    
      try {
        const res = await fetch(url, init);
        let data: unknown = null;
        try {
          data = await res.json();
        } catch {
          // non-JSON response — leave data as null
        }
        return { ok: res.ok, status: res.status, data };
      } finally {
        clearTimeout(timer);
      }
    }
  • src/index.ts:290-320 (registration)
    The MCP CallToolRequestSchema handler that receives tool calls, checks Pro key guard for toreador_create_session, then calls callTool which dispatches to the handler.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const name = request.params.name;
      const args = (request.params.arguments || {}) as ToolArgs;
    
      // Guard: Pro-only tool but no API key configured. Tell the LLM how to fix.
      if (PRO_TOOL_NAMES.has(name) && !HAS_API_KEY) {
        return {
          isError: true,
          content: [{
            type: "text" as const,
            text: `Tool ${name} requires a Toreador Pro plan API key. Set the TOREADOR_API_KEY environment variable in your MCP client config (format: tdr_...). Get a key at https://toreador.io/dashboard#api (Pro plan required: https://toreador.io/go-pro). The free tools (toreador_generate_qr) remain available for native tokens (BTC, ETH, SOL, POL, USDC on Solana) without a key.`,
          }],
        };
      }
    
      try {
        const result = await callTool(name, args);
        return formatToolResult(name, result);
      } catch (err) {
        const message = err instanceof Error ? err.message : String(err);
        return {
          isError: true,
          content: [
            {
              type: "text" as const,
              text: `Tool ${name} failed: ${message}`,
            },
          ],
        };
      }
    });
Behavior5/5

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

Discloses key behaviors: returns session ID, security code, and payment page URL; session expires after 15 minutes; requires pro plan. No annotations provided, but description adequately covers the mutation nature and constraints.

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?

Two sentences, front-loaded with the main purpose. No wasted words; each sentence provides useful information.

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 4-parameter create tool with no output schema, the description covers return values, expiration, and alternative tool. Lacks details on error scenarios or authentication, but is fairly complete for the task.

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 coverage is 100%, so baseline is 3. Description adds minimal extra meaning beyond the schema: it restates the allowed values for token and chainId but does not elaborate on format or constraints for amount or recipientAddress.

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?

Clearly states the tool creates a hosted payment session for ERC-20 stablecoins on EVM chains, listing specific tokens and chains. It distinguishes from the sibling toreador_generate_qr.

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?

Explicitly states when to use this tool (for ERC-20 stablecoins on EVM chains) and when not to (for native tokens or Solana SPL, use toreador_generate_qr). Also notes pro plan requirement.

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/Logitale/toreador-mcp-server'

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