Skip to main content
Glama
Logitale
by Logitale

toreador_generate_qr

Generate a crypto QR code for native tokens (BTC, ETH, SOL, POL) or Solana USDC. Returns the QR data URI and on-chain payment URI free of charge.

Instructions

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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesToken symbol. One of: BTC, ETH, SOL, POL, USDC (Solana only).
chainIdYesChain identifier. One of: bitcoin, ethereum, polygon, base, solana.
amountYesAmount 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.
recipientAddressYesDestination wallet address. Must match the chain (bech32 for BTC, EIP-55 for EVM, base58 for Solana).

Implementation Reference

  • Tool definition / input schema for toreador_generate_qr: declares name, description, and inputSchema (token, chainId, amount, recipientAddress). Listed in FREE_TIER_TOOLS — no API key required.
    {
      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,
      },
    },
  • Handler (dispatcher) for toreador_generate_qr: calls the Toreador public API POST /generate-qr with args.token, args.chainId, args.amount, args.recipientAddress via the toreadorRequest helper.
    switch (name) {
      case "toreador_generate_qr":
        return toreadorRequest("POST", "/generate-qr", {
          token: args.token,
          chainId: args.chainId,
          amount: args.amount,
          recipientAddress: args.recipientAddress,
        });
  • src/index.ts:237-250 (registration)
    Result formatting logic specific to toreador_generate_qr: when result is OK, adds a note for the LLM that qrCodeURL contains a base64 PNG data URI renderable as an image.
    if (name === "toreador_generate_qr" && result.data && typeof result.data === "object") {
      const d = result.data as { qrCodeURL?: string };
      const note = d.qrCodeURL
        ? "\n\nNote for the assistant: the qrCodeURL field contains a base64 PNG data URI that the user's client may render directly as an image."
        : "";
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(result.data, null, 2) + note,
          },
        ],
      };
    }
  • toreadorRequest helper: generic HTTP client used by all tool handlers, including toreador_generate_qr. Handles timeout (REQUEST_TIMEOUT_MS), JSON body, and optional API key header.
    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);
      }
    }
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It states the tool returns a QR data URI and payment URI, and that it is free, implying no state changes. However, it does not explicitly confirm non-destructiveness or describe side effects, but the context suggests a read-only operation.

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 concise with two sentences. The first sentence clearly defines the tool's purpose and output, and the second provides additional context (free usage and alternative). No unnecessary information, well front-loaded.

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

Completeness5/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, full schema coverage, and no output schema, the description sufficiently covers what the tool does, its inputs, and when to use it. It mentions the output structure (QR data URI and payment URI) and distinguishes sibling tools. No gaps are apparent.

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?

The input schema covers all 4 parameters with detailed descriptions (100% coverage). The description does not add significant meaning beyond what the schema already provides, such as the list of tokens and the requirement for decimal string amounts. Thus, baseline score of 3 is appropriate.

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 clearly states the tool generates a crypto QR code for specific native tokens and Solana SPL tokens, and specifies what it returns (QR data URI and payment URI). It distinguishes itself from the sibling tool toreador_create_session by noting that for ERC-20 stablecoins, that other tool should be used.

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 explicitly tells when to use this tool (for native tokens and Solana SPL tokens) and when to use the alternative toreador_create_session (for ERC-20 stablecoins). It also mentions that no API key is needed, providing clear usage context.

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