Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

get_identity

Retrieve the currently configured public key identity for anonymous physical address linking and transaction processing.

Instructions

Show the currently configured identity (W3SHIP_PUBLIC_KEY). Returns the public key and its type if set, or instructions on how to configure one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'get_identity' tool which returns information about the currently configured identity (W3SHIP_PUBLIC_KEY).
            return { content: [{ type: 'text', text: `Error adding tracking: ${e.message}` }], isError: true };
        }
    }
    
    case 'claim_promo': {
        const { listingId: claimListingId, publicKey: claimPK, fulfillmentChoice: claimFulfillment, pickupLocationId: claimPickupId } = args as any;
        const claimKey = claimPK || CONFIGURED_KEY;
    
        if (!claimKey) {
            return {
                content: [{ type: 'text', text: 'Error: Public key required to claim. Set W3SHIP_PUBLIC_KEY or provide publicKey.' }],
                isError: true,
            };
        }
    
        try {
            const claimRes = await fetch(`${W3SHIP_API}/api/listing/claim`, {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({
                    listingId: claimListingId,
                    publicKey: claimKey,
                    ...(claimFulfillment ? { fulfillmentChoice: claimFulfillment } : {}),
                    ...(claimPickupId ? { pickupLocationId: claimPickupId } : {}),
                }),
            });
            const claimData = await claimRes.json() as any;
    
            if (!claimRes.ok) {
                return {
                    content: [{
                        type: 'text',
                        text: JSON.stringify({
                            claimed: false,
                            error: claimData.error || 'Claim failed',
                            alreadyClaimed: claimData.alreadyClaimed || false,
                            ...(claimData.registerUrl ? { registerUrl: claimData.registerUrl } : {}),
                            ...(claimData.pickupLocations ? { availablePickupLocations: claimData.pickupLocations } : {}),
                        }, null, 2)
                    }],
                    isError: true,
                };
            }
    
            // Build response based on fulfillment type
            const isPickup = claimData.fulfillment === 'pickup';
            return {
                content: [{
                    type: 'text',
                    text: JSON.stringify({
                        claimed: true,
                        claimId: claimData.claimId,
                        fulfillment: claimData.fulfillment || 'ship',
                        item: claimData.listing?.title,
                        ...(isPickup ? {
                            pickupLocation: claimData.pickupLocation,
                            instructions: claimData.instructions,
                            cost: 'FREE',
                        } : {
                            shippingCost: claimData.listing?.shippingCost
                                ? `${claimData.listing.shippingCost} ${claimData.listing.currency}`
                                : 'FREE',
                        }),
                        remaining: claimData.listing?.remaining,
                        message: claimData.message,
                        nextStep: isPickup
                            ? `Show your claim ID "${claimData.claimId}" at ${claimData.pickupLocation?.name || 'the pickup location'} to collect your item.`
                            : `Add listing "${claimListingId}" to your cart and create an order. ${claimData.listing?.shippingCost ? `You'll pay ${claimData.listing.shippingCost} ${claimData.listing.currency} for shipping.` : ''}`,
                    }, null, 2)
                }]
            };
        } catch (e: any) {
            return { content: [{ type: 'text', text: `Error claiming promo: ${e.message}` }], isError: true };
        }
    }
  • src/index.ts:213-219 (registration)
    Registration of the 'get_identity' tool in the ListToolsRequestSchema handler.
        name: 'get_identity',
        description: 'Show the currently configured identity (W3SHIP_PUBLIC_KEY). Returns the public key and its type if set, or instructions on how to configure one.',
        inputSchema: {
            type: 'object',
            properties: {},
        },
    },
Behavior3/5

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

With no annotations, description carries full burden. Discloses conditional return behavior (public key/type vs. configuration instructions), which is valuable. Missing: side effects, error conditions, or format details of the 'instructions' return value.

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 with zero waste. Front-loaded with main action ('Show the currently configured identity'), followed by precise return value specification. Every clause 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?

Appropriately complete for a simple parameter-less getter. Compensates for missing output schema by describing both success states (key present vs. absent). Minor gap: lacks error handling description or return format specifics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Zero parameters present, establishing baseline 4. Description references W3SHIP_PUBLIC_KEY but as the resource identifier, not a parameter. No parameter documentation needed given empty input schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb 'Show' and specific resource 'configured identity (W3SHIP_PUBLIC_KEY)'. Clearly distinguishes from commerce-focused siblings (add_item, create_cart, etc.) as the sole identity/auth management tool. Minor gap: could explicitly state this is for authentication purposes.

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?

Implies usage context through 'if set' conditional, suggesting it's for checking authentication status. However, lacks explicit guidance on when to use versus alternatives (e.g., generate_demo_key) or prerequisites for other operations.

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