Skip to main content
Glama
FOX2920

WeWork MCP Server

by FOX2920

get_project_statistics

Retrieve comprehensive project statistics and performance metrics for WeWork project management by providing a project ID.

Instructions

Lấy thống kê tổng quan về dự án

Args:
    project_id: ID của dự án

Returns:
    Thống kê chi tiết về dự án

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes

Implementation Reference

  • The primary handler function for the 'get_project_statistics' MCP tool, decorated with @mcp.tool() for automatic registration. It computes comprehensive project statistics by fetching project info and task analysis data from the WeWorkClient, calculating metrics such as total tasks, status breakdown, assignee distribution, task types, and completion rate.
    @mcp.tool()
    def get_project_statistics(project_id: str) -> Dict[str, Any]:
        """
        Lấy thống kê tổng quan về dự án
        
        Args:
            project_id: ID của dự án
        
        Returns:
            Thống kê chi tiết về dự án
        """
        try:
            if not wework_client:
                return {'error': 'WeWork client not initialized'}
            
            logger.info(f"Getting statistics for project ID: {project_id}")
            
            # Lấy thông tin dự án
            project_info = wework_client.get_project_info(project_id)
            if not project_info:
                return {
                    'error': f'Không tìm thấy dự án với ID: {project_id}',
                    'success': False
                }
            
            # Phân tích tasks
            df = wework_client.get_project_analysis(project_id)
            
            if df.empty:
                return {
                    'success': True,
                    'project_name': project_info['name'],
                    'project_id': project_id,
                    'statistics': {
                        'total_tasks': 0,
                        'task_breakdown': {},
                        'assignee_breakdown': {},
                        'completion_rate': 0
                    }
                }
            
            # Tính các thống kê với kiểm tra column tồn tại
            total_tasks = len(df)
            status_counts = df['Trạng thái'].value_counts().to_dict() if 'Trạng thái' in df.columns else {}
            assignee_counts = df['Người thực hiện'].value_counts().to_dict() if 'Người thực hiện' in df.columns else {}
            task_type_counts = df['Loại công việc'].value_counts().to_dict() if 'Loại công việc' in df.columns else {}
            
            # Tính completion rate
            completed = status_counts.get('Hoàn thành', 0)
            completion_rate = (completed / total_tasks * 100) if total_tasks > 0 else 0
            
            return {
                'success': True,
                'project_name': project_info['name'],
                'project_id': project_id,
                'statistics': {
                    'total_tasks': total_tasks,
                    'task_breakdown': status_counts,
                    'assignee_breakdown': assignee_counts,
                    'task_type_breakdown': task_type_counts,
                    'completion_rate': round(completion_rate, 2),
                    'summary': {
                        'completed': status_counts.get('Hoàn thành', 0),
                        'in_progress': status_counts.get('Đang thực hiện', 0),
                        'failed': status_counts.get('Thất bại', 0)
                    }
                }
            }
            
        except Exception as e:
            logger.error(f"Error in get_project_statistics: {e}")
            return {'error': str(e), 'success': False}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a statistics retrieval operation but doesn't mention whether it's read-only, requires specific permissions, has rate limits, or what format the statistics are returned in. The description is too minimal for a tool with no annotation coverage.

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 appropriately concise with a clear purpose statement followed by Args and Returns sections. However, the Returns section 'Thống kê chi tiết về dự án' (Detailed statistics about the project) is somewhat redundant with the purpose statement and could be more specific.

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?

For a tool with no annotations, no output schema, and minimal behavioral disclosure, the description is incomplete. It doesn't explain what kind of statistics are returned, how they're formatted, or any behavioral characteristics. The description should provide more context given the lack of structured metadata.

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

Parameters4/5

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

The description includes an 'Args' section that explains the single parameter 'project_id' as 'ID của dự án' (ID of the project). With only 1 parameter and 0% schema description coverage, this minimal explanation is sufficient to understand the parameter's purpose, earning a baseline 4 for single-parameter tools.

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

Purpose3/5

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

The description states 'Lấy thống kê tổng quan về dự án' (Get overview statistics about the project), which provides a basic verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'get_project_details' or 'analyze_project_tasks', leaving ambiguity about what specific statistics are provided versus other project-related tools.

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?

No guidance is provided about when to use this tool versus alternatives like 'get_project_details' or 'analyze_project_tasks'. The description only states what the tool does, not when it's appropriate or what distinguishes it from similar tools in the sibling list.

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/FOX2920/Aplus-MCP'

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