fakestore_get_categories
Retrieve all available product categories from the Fake Store API to browse and filter e-commerce inventory efficiently.
Instructions
Get all available product categories
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/products.ts:38-43 (handler)The handler function that fetches product categories from the FakeStore API endpoint '/products/categories' using the 'get' utility./** * Get all product categories */ export async function getCategories(): Promise<string[]> { return get<string[]>('/products/categories'); }
- src/tools/products.ts:164-171 (schema)The tool schema definition including name, description, and empty input schema (no parameters required).{ name: 'fakestore_get_categories', description: 'Get all available product categories', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:68-73 (registration)The registration in the main tool call handler that maps the tool name to the getCategories function execution and formats the JSON response.if (name === 'fakestore_get_categories') { const result = await getCategories(); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }