Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

confirm_payment

Verify on-chain payments by submitting transaction hashes to update order status to paid. Confirm crypto transfers to seller wallets for order completion.

Instructions

Submit an on-chain payment transaction for verification. After paying the seller (send crypto to their wallet address), provide the transaction hash here to verify payment and update the order status to "paid".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderIdYesThe order ID to confirm payment for
txHashYesThe on-chain transaction hash (0x...)
chainIdNoChain ID where payment was sent. Default: 8453 (Base)

Implementation Reference

  • Handler implementation for the confirm_payment tool. It forwards the request to the centralized W3Ship API.
    case 'confirm_payment': {
        const { orderId: payOrderId, txHash, chainId: payChainId } = args as any;
        try {
            const payRes = await fetch(`${W3SHIP_API}/api/order/pay`, {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({
                    orderId: payOrderId,
                    txHash,
                    chainId: payChainId || 8453,
                }),
            });
            const payData = await payRes.json() as any;
    
            if (!payRes.ok) {
                return {
                    content: [{ type: 'text', text: `Payment verification failed: ${payData.error || 'Unknown error'}` }],
                    isError: true,
                };
            }
    
            return {
                content: [{
                    type: 'text',
                    text: JSON.stringify({
                        verified: payData.verified,
                        orderId: payOrderId,
                        txHash,
                        status: payData.order?.paymentStatus || 'paid',
                        message: payData.verified
                            ? `Payment verified! Order ${payOrderId} is confirmed. The seller will be notified to ship your item.`
                            : `Payment could not be verified. Please check the transaction hash.`,
                    }, null, 2)
                }]
            };
        } catch (e: any) {
            return { content: [{ type: 'text', text: `Error verifying payment: ${e.message}` }], isError: true };
        }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden and successfully discloses that this is a state-mutating operation ('update the order status'). However, it lacks details on validation logic (e.g., confirmation depth, amount verification), error scenarios, or side effects like seller notifications.

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 well-structured sentences with zero waste. The first states the core action; the second provides the workflow context and prerequisites. Information is front-loaded and every sentence earns its place.

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 100% schema coverage and clear workflow description, the essential information for successful invocation is present. However, for a financial transaction tool with no output schema or annotations, it lacks guidance on error cases (invalid hash, wrong chain) or what indicates successful verification.

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%, establishing a baseline of 3. The description adds workflow context ('provide the transaction hash here') that reinforces the parameter purpose, but does not add syntactic details or format constraints beyond what the schema already provides (e.g., '0x...' for txHash).

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 ('Submit an on-chain payment transaction for verification') and the outcome ('update the order status to paid'). It effectively distinguishes this from sibling tools like create_order (which precedes payment) and get_order (read-only).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit temporal guidance ('After paying the seller... provide the transaction hash here') establishing the correct sequence in the workflow. However, it does not explicitly mention alternative tools for different payment scenarios or failure recovery.

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

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