datalab_shopping_keyword_by_device
Analyze Naver Shopping keyword trends by device type (PC or mobile) over a specified time period to understand user behavior and optimize marketing strategies.
Instructions
Perform a trend analysis on Naver Shopping keywords 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) | |
| keyword | Yes | Search keyword | |
| startDate | Yes | Start date (yyyy-mm-dd) | |
| timeUnit | Yes | Time unit |
Implementation Reference
- src/handlers/datalab.handlers.ts:152-163 (handler)The main handler function that takes input parameters typed as DatalabShoppingKeywordDevice and calls the NaverSearchClient's datalabShoppingKeywordByDevice method with mapped arguments.export async function handleShoppingKeywordByDeviceTrend( params: DatalabShoppingKeywordDevice ) { return client.datalabShoppingKeywordByDevice({ startDate: params.startDate, endDate: params.endDate, timeUnit: params.timeUnit, category: params.category, keyword: params.keyword, device: params.device, }); }
- src/schemas/datalab.schemas.ts:67-72 (schema)Zod schema defining the input shape for the tool, extending DatalabBaseSchema with category, keyword, and device fields. Used in MCP registration as inputSchema.// 키워드 기기별 트렌드 스키마 export const DatalabShoppingKeywordDeviceSchema = DatalabBaseSchema.extend({ category: z.string().describe("Category code"), keyword: z.string().describe("Search keyword"), device: z.enum(["pc", "mo"]).describe("Device type"), });
- src/index.ts:377-390 (registration)MCP server tool registration, specifying the tool name, description, input schema, and handler invocation via datalabToolHandlers."datalab_shopping_keyword_by_device", { description: "📱🔍 Analyze keyword performance by device within shopping categories. Use find_category first to get category codes. Perfect for understanding mobile vs desktop shopping behavior for specific products. (쇼핑 키워드 기기별 트렌드 - 먼저 find_category 도구로 카테고리 코드를 찾으세요)", inputSchema: DatalabShoppingKeywordDeviceSchema.shape, }, async (args) => { const result = await datalabToolHandlers.datalab_shopping_keyword_by_device(args); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } );
- Core client method that performs the HTTP POST request to the Naver DataLab API endpoint for shopping keyword trends by device.async datalabShoppingKeywordByDevice( params: DatalabShoppingKeywordRequest ): Promise<DatalabShoppingResponse> { return this.post( `${this.datalabBaseUrl}/shopping/category/keyword/device`, params ); }
- src/handlers/datalab.handlers.ts:48-51 (handler)Entry in datalabToolHandlers map that logs the call and delegates to the main handleShoppingKeywordByDeviceTrend function.datalab_shopping_keyword_by_device: (args) => { console.error("datalab_shopping_keyword_by_device called with args:", JSON.stringify(args, null, 2)); return handleShoppingKeywordByDeviceTrend(args); },