Skip to main content
Glama
baskcart

W3 Ledger MCP Server

by baskcart

create_gift_card

Create gift cards by debiting customer balances with dual signatures, escrowing value until recipient claims.

Instructions

Create a gift card by debiting the customer's DAH balance. Requires dual signatures (customer + distribution). The card value is escrowed until the recipient claims it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customer_public_keyYesPublic key of the customer funding the gift card.
customer_partyKeyYesParty key identifying the customer.
cardInfoYesGift card details.
signatureYesCustomer transaction signature (EVM personal_sign).
distributionSignatureYesDistribution account co-signature for dual signing.
timestampYesISO 8601 timestamp of the transaction.

Implementation Reference

  • The handler logic for create_gift_card, which performs a POST request to the /giftcard endpoint.
    case 'create_gift_card': {
        const res = await client.post('/giftcard', args);
        return toResult(res.data, !res.ok);
    }
  • The JSON schema definition for the create_gift_card tool, including required inputs.
    {
        name: 'create_gift_card',
        description:
            'Create a gift card by debiting the customer\'s DAH balance. ' +
            'Requires dual signatures (customer + distribution). ' +
            'The card value is escrowed until the recipient claims it.',
        inputSchema: {
            type: 'object',
            properties: {
                customer_public_key: {
                    type: 'string',
                    description: 'Public key of the customer funding the gift card.',
                },
                customer_partyKey: {
                    type: 'string',
                    description: 'Party key identifying the customer.',
                },
                cardInfo: {
                    type: 'object',
                    description: 'Gift card details.',
                    properties: {
                        message: { type: 'string', description: 'Gift card message.' },
                        cardValue: {
                            type: 'number',
                            description: 'Value in DAH tokens (max 10,000).',
                            minimum: 0.01,
                            maximum: 10000,
                        },
                        selected_merchant: {
                            type: 'string',
                            description: 'Merchant the card is for.',
                        },
                        url: { type: 'string', description: 'Optional URL for the card.' },
                        customer_signature: {
                            type: 'string',
                            description: 'Customer\'s card signature.',
                        },
                    },
                    required: ['message', 'cardValue', 'selected_merchant'],
                },
                signature: {
                    type: 'string',
                    description: 'Customer transaction signature (EVM personal_sign).',
                },
                distributionSignature: {
                    type: 'string',
                    description: 'Distribution account co-signature for dual signing.',
                },
                timestamp: {
                    type: 'string',
                    description: 'ISO 8601 timestamp of the transaction.',
                },
            },
            required: [
                'customer_public_key',
                'customer_partyKey',
                'cardInfo',
                'signature',
                'distributionSignature',
                'timestamp',
            ],
        },
        access: 'write',
    },
Behavior4/5

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

With no annotations provided, description carries full burden and successfully discloses financial impact (DAH debit), authorization requirements (dual signatures), and state management (escrow until claimed). Minor gap on error conditions or reversibility.

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?

Three well-structured sentences: action (debit), authorization (dual-sig), and lifecycle (escrow). Every sentence conveys critical behavioral information with zero redundancy.

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

Completeness3/5

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

Adequate for the core transaction flow but missing output description (no output schema exists) and lacks guidance on cardInfo content (schema shows additionalProperties: {} with no constraints).

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 has 100% description coverage, establishing baseline 3. Description adds value by linking 'dual signatures' to the signature/distributionSignature parameters and explaining the customer funding context, but does not elaborate on the nested cardInfo structure.

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?

Description provides specific verb ('Create') + resource ('gift card') and distinguishes from siblings by specifying 'debiting the customer's DAH balance' (contrasting with create_sponsor_card) and 'escrowed until recipient claims' (contrasting with immediate transfers like purchase_product).

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?

Provides implied usage context through 'Requires dual signatures' and escrow mechanism, but lacks explicit when-to-use guidance or direct comparison to alternatives like create_sponsor_card or purchase_product.

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/baskcart/w3ledger-mcp-server'

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