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; }

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