Skip to main content
Glama

kya_getCard

Generate a single-use virtual Visa card for secure online purchases without exposing real payment details. The card is locked to a specific merchant and amount, then automatically deactivates after use.

Instructions

Get a single-use virtual Visa to make a purchase on behalf of the user. You MUST call kya_getAgentIdentity first — you cannot pay without being identified.

Declare the merchant, amount, and what you're buying. The user approves via MFA. kyaLabs issues a card locked to this purchase. The card self-destructs after use. Your user's real card never enters the chat.

Call kya_reportPurchase after the transaction.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
merchantYesThe merchant or store where the purchase will be made
estimated_amountYesEstimated purchase amount in USD (max $500)
descriptionYesBrief description of what is being purchased

Implementation Reference

  • The main handler function for kya_getCard, responsible for checking authentication, routing to API or mock implementation, and returning the result.
    export async function getCard(input: GetCardInput): Promise<CardResult> {
      process.stderr.write(`[kyaLabs:info] getCard called: merchant=${input.merchant} amount=$${input.estimated_amount}\n`);
    
      if (!getStoredConsentKey()) {
        process.stderr.write(`[kyaLabs:error] getCard: no consent key found\n`);
        return {
          product_name: "kyaLabs",
          status: "error",
          message: "Not authenticated. Run kya_getAgentIdentity first to activate your agent, or set KYA_API_KEY in your MCP config.",
        };
      }
    
      if (api.isApiMode()) {
        try {
          const result = await getCardViaApi(input);
          process.stderr.write(`[kyaLabs:info] getCard result: status=${result.status}\n`);
          return result;
        } catch (err) {
          process.stderr.write(`[kyaLabs:error] getCard API error: ${err instanceof Error ? err.message : String(err)}\n`);
          return {
            product_name: "kyaLabs",
            status: "error",
            message: err instanceof Error ? err.message : String(err),
          };
        }
      }
    
      return getCardViaMock(input);
    }
  • Type definitions for the input and output of the kya_getCard tool.
    export interface GetCardInput {
      merchant: string;
      estimated_amount: number;
      description: string;
    }
    
    export interface CardResult {
      product_name: string;
      status: string;
      intent_id?: string;
      card?: {
        number: string;
        exp_month: string | number;
        exp_year: string | number;
        cvv: string;
        billing_name?: string;
        last_four?: string;
      };
      merchant?: string;
      amount?: number;
      identity?: unknown;
      badge_warning?: string;
      remaining_balance?: number;
      instructions?: string;
      message?: string;
      reason?: string;
      merchant_url?: string;
      estimated_amount?: number;
      approve_endpoint?: string;
    }
  • src/index.ts:167-189 (registration)
    The tool registration for kya_getCard in the MCP server.
    server.tool(
      "kya_getCard",
      `Get a single-use virtual Visa to make a purchase on behalf of the user. You MUST call kya_getAgentIdentity first — you cannot pay without being identified.
    
    Declare the merchant, amount, and what you're buying. The user approves via MFA. kyaLabs issues a card locked to this purchase. The card self-destructs after use. Your user's real card never enters the chat.
    
    Call kya_reportPurchase after the transaction.`,
      {
        merchant: z.string().max(500).describe("The merchant or store where the purchase will be made"),
        estimated_amount: z.number().positive().max(500).describe("Estimated purchase amount in USD (max $500)"),
        description: z.string().max(1000).describe("Brief description of what is being purchased"),
      },
      async ({ merchant, estimated_amount, description }) => {
        const result = await getCard({ merchant, estimated_amount, description });
        const formatted = formatCardResponse(result, merchant, estimated_amount);
        return {
          content: [
            { type: "text", text: formatted },
            { type: "text", text: `\n---\n${JSON.stringify(result, null, 2)}` },
          ],
        };
      }
    );
Behavior4/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. It effectively describes key behavioral traits: the card is 'single-use,' 'locked to this purchase,' 'self-destructs after use,' requires 'user approves via MFA,' and protects user data ('Your user's real card never enters the chat'). However, it lacks details on error handling, rate limits, or specific MFA methods.

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 efficiently structured with zero waste: it front-loads the core purpose, lists prerequisites, explains parameters and process, describes security features, and specifies follow-up actions—all in five concise sentences. Each sentence earns its place by providing essential information without redundancy.

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?

Given the complexity of a financial transaction tool with no annotations or output schema, the description is largely complete: it covers purpose, prerequisites, parameters, user interaction (MFA), security model, and post-call actions. However, it lacks details on return values (e.g., card details) and potential error cases, which would be beneficial for full contextual understanding.

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%, providing clear documentation for all three parameters (merchant, estimated_amount, description). The description adds minimal semantic context beyond the schema, mentioning 'Declare the merchant, amount, and what you're buying,' which aligns with but doesn't significantly expand on the schema. This meets the baseline for high schema coverage.

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 specific action ('Get a single-use virtual Visa') and resource ('to make a purchase on behalf of the user'), distinguishing it from sibling tools like kya_getAgentIdentity (identification) and kya_reportPurchase (post-transaction reporting). It precisely defines the tool's function without being vague or tautological.

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 states when to use this tool ('to make a purchase') and provides clear prerequisites ('You MUST call kya_getAgentIdentity first — you cannot pay without being identified'). It also directs to alternatives for related actions ('Call kya_reportPurchase after the transaction'), offering comprehensive guidance on usage context and sequencing.

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/kyalabs-Io/payclaw-mcp'

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