get_group_statistics
Retrieve comprehensive team statistics, including member count, document numbers, read counts, and interaction data, to analyze group activity and engagement on the Yuque platform.
Instructions
获取团队的汇总统计数据,包括成员人数、文档数量、阅读量和互动数据等
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessToken | No | 用于认证 API 请求的令牌 | |
| login | Yes | 团队的登录名或唯一标识 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"accessToken": {
"description": "用于认证 API 请求的令牌",
"type": "string"
},
"login": {
"description": "团队的登录名或唯一标识",
"type": "string"
}
},
"required": [
"login"
],
"type": "object"
}
Implementation Reference
- src/services/yuque.ts:432-435 (handler)Core implementation of getGroupStatistics that makes the API call to fetch group statistics from Yuque.async getGroupStatistics(login: string): Promise<any> { const response = await this.client.get(`/groups/${login}/statistics`); return response.data.data; }
- src/server.ts:534-562 (registration)MCP tool registration for 'get_group_statistics', including input schema (login, optional accessToken) and wrapper handler that calls the service method.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}`, }, ], }; } }
- src/server.ts:537-540 (schema)Input schema definition using Zod for the get_group_statistics tool.{ login: z.string().describe("团队的登录名或唯一标识"), accessToken: z.string().optional().describe("用于认证 API 请求的令牌"), },