Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

search_listings

Find products on the W3Ship marketplace by category or keyword to view active listings with prices and seller details.

Instructions

Browse the W3Ship P2P marketplace. Search by category (electronics, gifts, clothing, etc.) or keyword. Returns active listings with prices and seller info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category (electronics, clothing, collectibles, home, sports, gifts, books, other)
keywordNoSearch keyword (matches title, description)
limitNoMax results to return. Default: 20

Implementation Reference

  • The implementation of the search_listings tool, which calls the W3Ship API to perform the search.
    case 'search_listings': {
        const { category: searchCat, keyword: searchKw, limit: searchLimit } = args as any;
    
        try {
            const params = new URLSearchParams();
            if (searchCat) params.set('category', searchCat.toLowerCase());
            if (searchKw) params.set('keyword', searchKw);
            if (searchLimit) params.set('limit', searchLimit.toString());
    
            const searchRes = await fetch(`${W3SHIP_API}/api/listing?${params.toString()}`);
            const searchData = await searchRes.json() as any;
            if (!searchRes.ok) {
                return { content: [{ type: 'text', text: `Error searching: ${searchData.error}` }], isError: true };
            }
    
            const listings = searchData.listings || [];
            if (listings.length === 0) {
                return {
                    content: [{
                        type: 'text',
                        text: JSON.stringify({
                            results: [],
                            message: searchCat
                                ? `No active listings in category "${searchCat}". Try: electronics, clothing, collectibles, home, sports, gifts, books, other.`
                                : searchKw
                                    ? `No listings matching "${searchKw}".`
                                    : 'No active listings yet. Be the first — use create_listing to sell something!',
                        }, null, 2)
                    }]
                };
            }
    
            const results = listings.map((l: any) => ({
                id: l.id, title: l.title,
                price: l.isPromo ? `FREE (shipping: ${l.shippingCost || 0} ${l.currency})` : `${l.price} ${l.currency}`,
                category: l.category, condition: l.condition,
                seller: l.sellerName || (l.sellerAddress?.substring(0, 10) + '...'),
                shipsTo: l.shipsTo, quantity: l.quantity,
                ...(l.isPromo ? { promo: true, remaining: l.promoQuantity ? l.promoQuantity - (l.promoClaimed || 0) : undefined } : {}),
            }));
    
            return {
                content: [{
                    type: 'text',
                    text: JSON.stringify({
                        results, total: results.length,
                        message: `Found ${results.length} listing(s). Use get_listing with the ID for full details, or add_item with productOffering.id to add to cart.`,
                    }, null, 2)
                }]
            };
        } catch (e: any) {
            return { content: [{ type: 'text', text: `Error searching listings: ${e.message}` }], isError: true };
        }
    }
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses return content ('active listings with prices and seller info') and state filtering ('active'). However, missing pagination behavior, sorting logic, or error conditions that would be expected for a search tool.

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 with zero waste. Front-loaded with action ('Browse'), followed by usage mechanics, then return value. 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?

Adequately compensates for missing output schema by describing return structure (prices, seller info). Given simple 3-parameter input and no nested objects, description covers essential context, though could note pagination or result ordering.

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 coverage is 100%, establishing baseline 3. Description reinforces parameter meaning by categorizing them as search mechanisms and providing category examples, but doesn't add syntax details or validation rules beyond the 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+resource ('Browse the W3Ship P2P marketplace', 'Search by category...'). Distinguishes from sibling 'get_listing' through plural 'listings' and search/filter semantics, though it doesn't explicitly name the sibling alternative.

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 through parameter explanation ('Search by category... or keyword'), indicating when filters apply. However, lacks explicit when-to-use guidance versus 'get_listing' or other sibling tools like 'create_listing'.

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