datalab_shopping_by_gender
Analyze Naver Shopping trends by gender to identify consumer preferences. Input category, time range, and gender for detailed insights.
Instructions
Perform a trend analysis on Naver Shopping by gender. (네이버 쇼핑 성별 트렌드 분석)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category code | |
| endDate | Yes | End date (yyyy-mm-dd) | |
| gender | Yes | Gender | |
| startDate | Yes | Start date (yyyy-mm-dd) | |
| timeUnit | Yes | Time unit |
Implementation Reference
- src/handlers/datalab.handlers.ts:102-112 (handler)The core handler function that takes typed parameters (DatalabShoppingGender) and invokes the Naver client method to fetch shopping category trends by gender.export async function handleShoppingByGenderTrend( params: DatalabShoppingGender ) { return client.datalabShoppingByGender({ startDate: params.startDate, endDate: params.endDate, timeUnit: params.timeUnit, category: params.category, gender: params.gender, }); }
- src/schemas/datalab.schemas.ts:41-44 (schema)Zod schema defining the input parameters for the datalab_shopping_by_gender tool: startDate, endDate, timeUnit (inherited), category, and gender.export const DatalabShoppingGenderSchema = DatalabBaseSchema.extend({ category: z.string().describe("Category code"), gender: z.enum(["f", "m"]).describe("Gender"), });
- src/index.ts:320-337 (registration)MCP tool registration in the main server, specifying the tool name, description, input schema (derived from DatalabShoppingGenderSchema), and thin wrapper handler that delegates to datalabToolHandlers."datalab_shopping_by_gender", { description: "👥 Analyze shopping trends by gender (Male vs Female). Use find_category first. BUSINESS CASES: Gender-targeted marketing, product positioning, demographic analysis. EXAMPLE: '화장품 쇼핑에서 남녀 비율은?' For current gender trends, use get_current_korean_time to set proper analysis period. (성별 쇼핑 트렌드 분석 - 먼저 find_category 도구로 카테고리 코드를 찾고, 현재 성별 트렌드 분석시 get_current_korean_time으로 적절한 분석 기간 설정)", inputSchema: DatalabShoppingGenderSchema.pick({ startDate: true, endDate: true, timeUnit: true, category: true, gender: true, }).shape, }, async (args) => { const result = await datalabToolHandlers.datalab_shopping_by_gender(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- Client method that performs the actual HTTP POST request to Naver DataLab API endpoint for shopping trends by gender.async datalabShoppingByGender( params: DatalabShoppingGenderRequest ): Promise<DatalabShoppingResponse> { return this.post(`${this.datalabBaseUrl}/shopping/category/gender`, params); }
- Entry in datalabToolHandlers map that logs the call and delegates to the specific handleShoppingByGenderTrend function.datalab_shopping_by_gender: (args) => { console.error("datalab_shopping_by_gender called with args:", JSON.stringify(args, null, 2)); return handleShoppingByGenderTrend(args);