search_brands
Search Vinted's brand catalogue by keyword to find matching brands with IDs, item counts, and favourite counts. Use returned IDs to filter items by brand.
Instructions
Search Vinted's brand catalogue by keyword. Returns matching brands with their numeric IDs, slugs, total item counts, and favourite counts. Pass the returned IDs to search_items.brandIds, or use search_items.brand[] to pass names and have them resolved automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Brand name keyword to search for, e.g. "Nike" or "Levi" | |
| country | No | Country site to query (brand catalogues are shared across countries) | fr |
| limit | No | Maximum number of brand results to return |
Implementation Reference
- src/mcp.ts:98-110 (schema)Tool schema definition for search_brands, declaring input parameters (query, country, limit) in the MCP tool list.
{ name: 'search_brands', description: 'Search Vinted\'s brand catalogue by keyword. Returns matching brands with their numeric IDs, slugs, total item counts, and favourite counts. Pass the returned IDs to search_items.brandIds, or use search_items.brand[] to pass names and have them resolved automatically.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Brand name keyword to search for, e.g. "Nike" or "Levi"' }, country: { type: 'string', enum: COUNTRIES, default: 'fr', description: 'Country site to query (brand catalogues are shared across countries)' }, limit: { type: 'integer', default: 10, description: 'Maximum number of brand results to return' }, }, required: ['query'], }, }, - src/mcp.ts:219-219 (registration)Tool handler dispatch — routes 'search_brands' calls to the opBrands function.
case 'search_brands': result = await opBrands(c, a as any); break; - src/ops/brands.ts:5-12 (handler)Handler function opBrands — validates input, calls the endpoint, and limits results.
export async function opBrands( client: VintedClient, input: { query: string; country?: Country; limit?: number }, ): Promise<BrandHit[]> { if (!input.query?.trim()) throw new Error('query is required'); const r = await searchBrands(client, input.query, input.country ?? 'fr'); return r.slice(0, input.limit ?? 10); } - src/client/endpoints.ts:276-293 (handler)Actual API call to Vinted's /api/v2/brands endpoint, mapping response to BrandHit objects.
export async function searchBrands( client: VintedClient, keyword: string, country: Country = 'fr', ): Promise<BrandHit[]> { if (!keyword.trim()) return []; const data = await client.apiGet<{ brands?: any[] }>( country, `/api/v2/brands?keyword=${encodeURIComponent(keyword)}`, ); return (data.brands ?? []).map((b) => ({ id: Number(b.id), title: String(b.title ?? ''), slug: String(b.slug ?? ''), itemCount: b.item_count, favouriteCount: b.favourite_count, })); } - src/client/endpoints.ts:268-274 (schema)Type definition for BrandHit — the return type of search_brands.
export interface BrandHit { id: number; title: string; slug: string; itemCount?: number; favouriteCount?: number; }