Skip to main content
Glama

get_group_statistics

Retrieve comprehensive team statistics from Yuque, including member count, document numbers, read counts, and interaction data for analysis.

Instructions

获取团队的汇总统计数据,包括成员人数、文档数量、阅读量和互动数据等

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loginYes团队的登录名或唯一标识
accessTokenNo用于认证 API 请求的令牌

Implementation Reference

  • The main MCP tool handler function that receives parameters, creates a YuqueService instance, calls getGroupStatistics on it, and returns formatted JSON response or error message.
    async ({ login, accessToken }) => {
      try {
        Logger.log(`Fetching statistics for group: ${login}`);
        const yuqueService = this.createYuqueService(accessToken);
        const stats = await yuqueService.getGroupStatistics(login);
    
        Logger.log(`Successfully fetched statistics for group: ${login}`);
        return {
          content: [{ type: "text", text: JSON.stringify(stats, null, 2) }],
        };
      } catch (error) {
        Logger.error(`Error fetching statistics for group ${login}:`, error);
        return {
          content: [
            {
              type: "text",
              text: `Error fetching group statistics: ${error}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameters for the tool: login (required string) and accessToken (optional string).
    {
      login: z.string().describe("团队的登录名或唯一标识"),
      accessToken: z.string().optional().describe("用于认证 API 请求的令牌"),
    },
  • src/server.ts:534-563 (registration)
    Registration of the 'get_group_statistics' tool with the MCP server, including name, description, schema, and handler function.
    this.server.tool(
      "get_group_statistics",
      "获取团队的汇总统计数据,包括成员人数、文档数量、阅读量和互动数据等",
      {
        login: z.string().describe("团队的登录名或唯一标识"),
        accessToken: z.string().optional().describe("用于认证 API 请求的令牌"),
      },
      async ({ login, accessToken }) => {
        try {
          Logger.log(`Fetching statistics for group: ${login}`);
          const yuqueService = this.createYuqueService(accessToken);
          const stats = await yuqueService.getGroupStatistics(login);
    
          Logger.log(`Successfully fetched statistics for group: ${login}`);
          return {
            content: [{ type: "text", text: JSON.stringify(stats, null, 2) }],
          };
        } catch (error) {
          Logger.error(`Error fetching statistics for group ${login}:`, error);
          return {
            content: [
              {
                type: "text",
                text: `Error fetching group statistics: ${error}`,
              },
            ],
          };
        }
      }
    );
  • Helper service method in YuqueService class that makes the API request to retrieve group statistics from Yuque.
    async getGroupStatistics(login: string): Promise<any> {
      const response = await this.client.get(`/groups/${login}/statistics`);
      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 full burden. It states this is a read operation ('获取' - get/retrieve) which implies non-destructive behavior, but doesn't disclose authentication requirements (though the schema shows accessToken parameter), rate limits, error conditions, or what happens if the team doesn't exist. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 states the purpose and enumerates key metrics. It's appropriately sized for a read operation with clear parameters. Every element serves a purpose, though it could be slightly more structured by separating purpose from metric examples.

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

Completeness3/5

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

For a read-only statistics tool with 100% schema coverage but no output schema, the description adequately covers what metrics are returned. However, without annotations and with multiple sibling tools offering similar functionality, it should provide more context about when to choose this comprehensive tool versus more specific alternatives. The lack of output schema means the description should ideally hint at return format.

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 already documents both parameters (login and accessToken) with descriptions. The tool description adds no parameter-specific information beyond what's in the schema. With complete schema coverage, the baseline is 3 even without additional param details in the description.

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 summary statistics) and lists specific metrics like member count, document count, reading volume, and interaction data. It distinguishes from siblings like get_group_book_statistics or get_group_member_statistics by covering multiple aggregated metrics rather than specific subsets. However, it doesn't explicitly name the sibling tools for comparison.

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. With siblings like get_group_book_statistics, get_group_doc_statistics, and get_group_member_statistics that retrieve specific subsets of statistics, there's no indication of when this comprehensive tool is preferred over those more targeted tools. No prerequisites or exclusions are mentioned.

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