Skip to main content
Glama

get-stats

Retrieve page view statistics for your note.com dashboard to analyze traffic trends and content performance.

Instructions

ダッシュボードのPV統計情報を取得する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNo期間フィルターall
pageNoページ番号
sortNoソート方法(pv: PV数順, date: 日付順)pv

Implementation Reference

  • 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, "統計情報取得");
      }
    }
  • 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: 日付順)"),
    },
  • 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, "統計情報取得");
        }
      }
    );
  • Registration of user tools module (which includes get-stats) in the central registerAllTools function.
    registerUserTools(server);
  • Invocation of registerAllTools during server initialization, which indirectly registers the get-stats tool.
    registerAllTools(server);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shimayuz/note-com-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server