Skip to main content
Glama

get_group_member_statistics

Retrieve team member statistics from Yuque, including edit counts, read counts, like counts, and document contributions, with filtering and sorting options.

Instructions

获取团队成员的统计数据,包括各成员的编辑次数、阅读量、点赞量等

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loginYes团队的登录名或唯一标识
nameNo成员名称,用于过滤特定成员
rangeNo时间范围(0: 全部, 30: 近30天, 365: 近一年)
pageNo页码,默认为1
limitNo每页数量,默认为10,最大为20
sortFieldNo排序字段,可选值:write_doc_count、write_count、read_count、like_count
sortOrderNo排序方向,可选值:desc(降序)、asc(升序),默认为desc
accessTokenNo用于认证 API 请求的令牌

Implementation Reference

  • The MCP tool handler function that processes the input parameters, creates a YuqueService instance, calls getGroupMemberStatistics, and returns the result as formatted JSON.
      try {
        const { login, accessToken, ...queryParams } = params;
        Logger.log(`Fetching member statistics for group: ${login}`);
        const yuqueService = this.createYuqueService(accessToken);
        const stats = await yuqueService.getGroupMemberStatistics(
          login,
          queryParams
        );
    
        Logger.log(
          `Successfully fetched member statistics for group: ${login}`
        );
        return {
          content: [{ type: "text", text: JSON.stringify(stats, null, 2) }],
        };
      } catch (error) {
        Logger.error(
          `Error fetching member statistics for group ${params.login}:`,
          error
        );
        return {
          content: [
            {
              type: "text",
              text: `Error fetching group member statistics: ${error}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameters for the get_group_member_statistics tool.
      login: z.string().describe("团队的登录名或唯一标识"),
      name: z.string().optional().describe("成员名称,用于过滤特定成员"),
      range: z
        .number()
        .optional()
        .describe("时间范围(0: 全部, 30: 近30天, 365: 近一年)"),
      page: z.number().optional().describe("页码,默认为1"),
      limit: z.number().optional().describe("每页数量,默认为10,最大为20"),
      sortField: z
        .string()
        .optional()
        .describe(
          "排序字段,可选值:write_doc_count、write_count、read_count、like_count"
        ),
      sortOrder: z
        .enum(["desc", "asc"])
        .optional()
        .describe("排序方向,可选值:desc(降序)、asc(升序),默认为desc"),
      accessToken: z.string().optional().describe("用于认证 API 请求的令牌"),
    },
  • src/server.ts:566-621 (registration)
    Registration of the get_group_member_statistics tool on the MCP server, including name, description, schema, and handler.
    this.server.tool(
      "get_group_member_statistics",
      "获取团队成员的统计数据,包括各成员的编辑次数、阅读量、点赞量等",
      {
        login: z.string().describe("团队的登录名或唯一标识"),
        name: z.string().optional().describe("成员名称,用于过滤特定成员"),
        range: z
          .number()
          .optional()
          .describe("时间范围(0: 全部, 30: 近30天, 365: 近一年)"),
        page: z.number().optional().describe("页码,默认为1"),
        limit: z.number().optional().describe("每页数量,默认为10,最大为20"),
        sortField: z
          .string()
          .optional()
          .describe(
            "排序字段,可选值:write_doc_count、write_count、read_count、like_count"
          ),
        sortOrder: z
          .enum(["desc", "asc"])
          .optional()
          .describe("排序方向,可选值:desc(降序)、asc(升序),默认为desc"),
        accessToken: z.string().optional().describe("用于认证 API 请求的令牌"),
      },
      async (params) => {
        try {
          const { login, accessToken, ...queryParams } = params;
          Logger.log(`Fetching member statistics for group: ${login}`);
          const yuqueService = this.createYuqueService(accessToken);
          const stats = await yuqueService.getGroupMemberStatistics(
            login,
            queryParams
          );
    
          Logger.log(
            `Successfully fetched member statistics for group: ${login}`
          );
          return {
            content: [{ type: "text", text: JSON.stringify(stats, null, 2) }],
          };
        } catch (error) {
          Logger.error(
            `Error fetching member statistics for group ${params.login}:`,
            error
          );
          return {
            content: [
              {
                type: "text",
                text: `Error fetching group member statistics: ${error}`,
              },
            ],
          };
        }
      }
    );
  • Helper method in YuqueService that makes the actual API request to retrieve group member statistics from Yuque.
    async getGroupMemberStatistics(login: string, params?: {
      name?: string;
      range?: number;
      page?: number;
      limit?: number;
      sortField?: string;
      sortOrder?: 'desc' | 'asc';
    }): Promise<any> {
      const response = await this.client.get(`/groups/${login}/statistics/members`, { params });
      return response.data.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes a read operation ('获取' - get) but doesn't mention authentication requirements (though 'accessToken' is in the schema), rate limits, pagination behavior (implied by 'page' and 'limit' but not explained), or what happens on errors. For a tool with 8 parameters and no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids redundancy and wastes no words, though it could be slightly more structured (e.g., by explicitly listing key metrics). Every part earns its place by specifying what statistics are included.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, no annotations, no output schema), the description is incomplete. It lacks details on authentication, pagination, error handling, and output format (e.g., what data is returned beyond the mentioned metrics). Without annotations or an output schema, the description should compensate more to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 8 parameters with descriptions, enums, and defaults. The description adds no additional parameter semantics beyond implying statistics include '编辑次数、阅读量、点赞量等' (edit count, read count, like count, etc.), which loosely relates to 'sortField' options but doesn't clarify parameter usage or interactions. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '获取团队成员的统计数据,包括各成员的编辑次数、阅读量、点赞量等' (Get team member statistics, including each member's edit count, read count, like count, etc.). It specifies the verb ('获取' - get) and resource ('团队成员统计数据' - team member statistics) with concrete examples of metrics. However, it doesn't explicitly differentiate from sibling tools like 'get_group_statistics' or 'get_group_doc_statistics', which appear related.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_group_statistics' or 'get_group_doc_statistics', nor does it specify prerequisites (e.g., needing an access token) or exclusions. Usage is implied by the purpose but lacks explicit context for selection among similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/HenryHaoson/Yuque-MCP-Server'

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