Skip to main content
Glama
brysontang

DeltaTask MCP Server

by brysontang

get_statistics

Retrieve task completion rates and urgency distribution data to analyze productivity and workload patterns in your task management system.

Instructions

Get task statistics including completion rates and urgency distribution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:71-74 (handler)
    MCP tool handler and registration for 'get_statistics'. This async function is decorated with @mcp.tool(), making it the entry point for the tool, and delegates to TaskService.get_statistics().
    @mcp.tool()
    async def get_statistics() -> dict[str, Any]:
        """Get task statistics including completion rates and urgency distribution."""
        return service.get_statistics()
  • TaskService helper method that proxies the get_statistics call to the repository layer.
    def get_statistics(self) -> Dict[str, Any]:
        """Get task statistics."""
        return self.repository.get_statistics()
  • Core implementation of statistics computation in the repository. Queries the database for total tasks, completed tasks, completion rate, tasks by urgency level, and tasks with upcoming deadlines within a week.
    def get_statistics(self) -> Dict[str, Any]:
        """Get task statistics."""
        with self.session_scope() as session:
            total = session.query(Todo).count()
            completed = session.query(Todo).filter(Todo.completed == True).count()
            
            # Count by urgency
            by_urgency = {}
            for urgency in range(1, 6):
                count = session.query(Todo).filter(Todo.completed == False, Todo.urgency == urgency).count()
                by_urgency[urgency] = count
            
            # Count upcoming deadlines
            from datetime import datetime
            today = datetime.now().date().isoformat()
            week_later = today.replace(today[:8], str(int(today[8:]) + 7))
            upcoming_deadlines = session.query(Todo).filter(
                Todo.completed == False,
                Todo.deadline.between(today, week_later)
            ).count()
            
            return {
                "total": total,
                "completed": completed,
                "completion_rate": (completed / total * 100) if total > 0 else 0,
                "by_urgency": by_urgency,
                "upcoming_deadlines": upcoming_deadlines
            }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get'), but doesn't address important behavioral aspects like whether this aggregates data across all tasks, requires specific permissions, has rate limits, or provides real-time versus cached statistics.

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

Conciseness5/5

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

The description is a single, efficient sentence that communicates the essential purpose without any wasted words. It's appropriately sized for a zero-parameter tool and front-loads the core functionality.

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?

Given the tool has zero parameters, 100% schema coverage, and an output schema exists, the description is reasonably complete for its core purpose. However, as a statistical aggregation tool with no annotations, it should ideally provide more context about scope (e.g., 'across all tasks' or 'for current user') and behavioral characteristics.

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 tool has zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't discuss parameters, maintaining focus on what statistics are returned rather than how to filter them.

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 as retrieving task statistics with specific metrics (completion rates and urgency distribution). It uses a specific verb ('Get') and resource ('task statistics'), but doesn't explicitly distinguish this from sibling tools like 'list_tasks' or 'search_tasks' which might also provide statistical insights.

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 when this statistical view is preferable to listing or searching tasks, nor does it specify any prerequisites or contextual constraints for usage.

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/brysontang/DeltaTask'

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