get-stats
Retrieve page view statistics from your note.com dashboard with customizable filters for time periods, sorting options, and pagination to analyze 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 main handler function for the 'get-stats' tool. It fetches PV (page view) statistics from the note.com dashboard API endpoint '/v1/stats/pv', supporting filters like 'all', 'day', etc., pagination, and sorting by PV or 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/user-tools.ts:113-116 (schema)Zod input schema defining parameters for the 'get-stats' tool: filter (enum: all/day/week/month), page (number), sort (enum: pv/date).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)Registration of the 'get-stats' tool on the MCP server using server.tool(), including 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:16-17 (registration)Higher-level registration call to registerUserTools as part of registerAllTools.registerUserTools(server); registerMembershipTools(server);
- src/note-mcp-server-refactored.ts:41-41 (registration)Call to registerAllTools in the main refactored MCP server initialization.registerAllTools(server);