get-stats
Retrieve page view statistics for your note.com dashboard to analyze traffic trends and content performance.
Instructions
ダッシュボードのPV統計情報を取得する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | 期間フィルター | all |
| page | No | ページ番号 | |
| sort | No | ソート方法(pv: PV数順, date: 日付順) | pv |
Implementation Reference
- src/tools/user-tools.ts:117-125 (handler)The handler function for the 'get-stats' tool. It makes an API request to fetch PV statistics data using the provided filter, page, and sort parameters, handles the response, and manages errors.async ({ filter, page, sort }) => { try { const data = await noteApiRequest(`/v1/stats/pv?filter=${filter}&page=${page}&sort=${sort}`, "GET", null, true); return createSuccessResponse(data); } catch (error) { return handleApiError(error, "統計情報取得"); } }
- src/tools/user-tools.ts:112-116 (schema)Zod input schema for the 'get-stats' tool defining parameters: filter (enum: all, day, week, month; default all), page (number; default 1), sort (enum: pv, date; default pv).{ filter: z.enum(["all", "day", "week", "month"]).default("all").describe("期間フィルター"), page: z.number().default(1).describe("ページ番号"), sort: z.enum(["pv", "date"]).default("pv").describe("ソート方法(pv: PV数順, date: 日付順)"), },
- src/tools/user-tools.ts:109-126 (registration)Direct registration of the 'get-stats' tool on the MCP server, specifying name, description, input schema, and handler function.server.tool( "get-stats", "ダッシュボードのPV統計情報を取得する", { filter: z.enum(["all", "day", "week", "month"]).default("all").describe("期間フィルター"), page: z.number().default(1).describe("ページ番号"), sort: z.enum(["pv", "date"]).default("pv").describe("ソート方法(pv: PV数順, date: 日付順)"), }, async ({ filter, page, sort }) => { try { const data = await noteApiRequest(`/v1/stats/pv?filter=${filter}&page=${page}&sort=${sort}`, "GET", null, true); return createSuccessResponse(data); } catch (error) { return handleApiError(error, "統計情報取得"); } } );
- src/tools/index.ts:19-19 (registration)Registration of user tools module (which includes get-stats) in the central registerAllTools function.registerUserTools(server);
- src/note-mcp-server-refactored.ts:41-41 (registration)Invocation of registerAllTools during server initialization, which indirectly registers the get-stats tool.registerAllTools(server);