datalab_shopping_by_device
Analyze shopping trends on Naver by device type (PC or mobile) to identify user behavior patterns and optimize marketing strategies over specific time periods.
Instructions
Perform a trend analysis on Naver Shopping by device. (네이버 쇼핑 기기별 트렌드 분석)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category code | |
| device | Yes | Device type | |
| endDate | Yes | End date (yyyy-mm-dd) | |
| startDate | Yes | Start date (yyyy-mm-dd) | |
| timeUnit | Yes | Time unit |
Implementation Reference
- src/handlers/datalab.handlers.ts:80-95 (handler)Handler function that takes DatalabShoppingDevice parameters, maps them, and delegates to the NaverSearchClient's datalabShoppingByDevice method to fetch shopping trends by device./** * 쇼핑 기기별 트렌드 핸들러 * 네이버 데이터랩 쇼핑 기기별 트렌드 분석 API 호출 * @param params DatalabShoppingDevice */ export async function handleShoppingByDeviceTrend( params: DatalabShoppingDevice ) { return client.datalabShoppingByDevice({ startDate: params.startDate, endDate: params.endDate, timeUnit: params.timeUnit, category: params.category, device: params.device, }); }
- src/schemas/datalab.schemas.ts:35-38 (schema)Zod input schema for the datalab_shopping_by_device tool, extending base schema with category code and device (pc/mo).export const DatalabShoppingDeviceSchema = DatalabBaseSchema.extend({ category: z.string().describe("Category code"), device: z.enum(["pc", "mo"]).describe("Device type"), });
- src/index.ts:298-317 (registration)MCP server registration of the 'datalab_shopping_by_device' tool, specifying description, input schema (subset of DatalabShoppingDeviceSchema), and async handler that calls datalabToolHandlers and formats response.server.registerTool( "datalab_shopping_by_device", { description: "📱 Analyze shopping trends by device (PC vs Mobile). Use find_category first. BUSINESS CASES: Mobile commerce strategy, responsive design priority, device-specific campaigns. EXAMPLE: 'PC 사용자가 더 많이 구매하는 카테고리는?' For current device trends, use get_current_korean_time to set proper analysis period. (기기별 쇼핑 트렌드 분석 - 먼저 find_category 도구로 카테고리 코드를 찾고, 현재 기기 트렌드 분석시 get_current_korean_time으로 적절한 분석 기간 설정)", inputSchema: DatalabShoppingDeviceSchema.pick({ startDate: true, endDate: true, timeUnit: true, category: true, device: true, }).shape, }, async (args) => { const result = await datalabToolHandlers.datalab_shopping_by_device(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } );
- NaverSearchClient method that performs the HTTP POST request to Naver DataLab API endpoint for shopping category trends by device.*/ async datalabShoppingByDevice( params: DatalabShoppingDeviceRequest ): Promise<DatalabShoppingResponse> { return this.post(`${this.datalabBaseUrl}/shopping/category/device`, params); }
- src/handlers/datalab.handlers.ts:32-34 (registration)Internal handler map registration in datalabToolHandlers object that logs args and calls the specific handleShoppingByDeviceTrend function.datalab_shopping_by_device: (args) => { console.error("datalab_shopping_by_device called with args:", JSON.stringify(args, null, 2)); return handleShoppingByDeviceTrend(args);