Skip to main content
Glama

get_activity_logs

Retrieve activity logs from Chronos Protocol with filtering options including activity type, task scope, date range, and result limits for tracking and analysis.

Instructions

Retrieve activity logs with optional filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activityTypeNoFilter by activity type
endDateNoFilter by end date (ISO 8601 format)
limitNoMaximum number of logs to return
startDateNoFilter by start date (ISO 8601 format)
task_scopeNoFilter by task scope

Implementation Reference

  • MCP tool handler for 'get_activity_logs': parses arguments into filters dict and delegates execution to Database.get_activity_logs method.
    case TimeTools.GET_ACTIVITY_LOGS.value:
        filters = {}
        for key in ["activityType", "task_scope", "startDate", "endDate", "limit"]:
            if key in arguments:
                filters[key] = arguments[key]
    
        result = time_server.db.get_activity_logs(filters)
  • Input schema / JSON Schema definition for the get_activity_logs tool, defining optional filter parameters.
    inputSchema={
        "type": "object",
        "properties": {
            "activityType": {
                "type": "string",
                "description": "Filter by activity type",
            },
            "task_scope": {
                "type": "string",
                "enum": [scope.value for scope in TaskScope],
                "description": "Filter by task scope",
            },
            "startDate": {
                "type": "string",
                "description": "Filter by start date (ISO 8601 format)",
            },
            "endDate": {
                "type": "string",
                "description": "Filter by end date (ISO 8601 format)",
            },
            "limit": {
                "type": "integer",
                "description": "Maximum number of logs to return",
            },
        },
    },
  • Core implementation of get_activity_logs: filters, sorts (newest first), limits, and returns list of activity logs from JSON storage.
    def get_activity_logs(self, filters: Dict[str, Any] = None) -> List[Dict[str, Any]]:
        """Get activity logs with optional filtering"""
        logs = self.activity_logs.copy()
        
        if filters:
            if 'activityType' in filters:
                logs = [log for log in logs if log['activityType'] == filters['activityType']]
            if 'task_scope' in filters:
                logs = [log for log in logs if log['task_scope'] == filters['task_scope']]
            if 'startDate' in filters:
                start_date = datetime.fromisoformat(filters['startDate'].replace('Z', '+00:00'))
                logs = [log for log in logs if datetime.fromisoformat(log['startTime'].replace('Z', '+00:00')) >= start_date]
            if 'endDate' in filters:
                end_date = datetime.fromisoformat(filters['endDate'].replace('Z', '+00:00'))
                logs = [log for log in logs if datetime.fromisoformat(log['startTime'].replace('Z', '+00:00')) <= end_date]
        
        # Sort by start time (newest first)
        logs.sort(key=lambda x: x['startTime'], reverse=True)
        
        if filters and 'limit' in filters:
            logs = logs[:filters['limit']]
        
        return logs
  • Tool registration in @server.list_tools(): defines name, description, and inputSchema for get_activity_logs.
    Tool(
        name=TimeTools.GET_ACTIVITY_LOGS.value,
        description="Retrieve activity logs with optional filtering",
        inputSchema={
            "type": "object",
            "properties": {
                "activityType": {
                    "type": "string",
                    "description": "Filter by activity type",
                },
                "task_scope": {
                    "type": "string",
                    "enum": [scope.value for scope in TaskScope],
                    "description": "Filter by task scope",
                },
                "startDate": {
                    "type": "string",
                    "description": "Filter by start date (ISO 8601 format)",
                },
                "endDate": {
                    "type": "string",
                    "description": "Filter by end date (ISO 8601 format)",
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of logs to return",
                },
            },
        },
    ),
  • Pydantic schema for ActivityLog entries returned by get_activity_logs.
    class ActivityLog(BaseModel):
        activityId: str  # Changed from timeId for better naming
        activityType: str
        task_scope: TaskScope
        description: Optional[str] = None
        tags: Optional[List[str]] = None
        startTime: str
        endTime: Optional[str] = None
        duration: Optional[str] = None
        durationSeconds: Optional[int] = None
        result: Optional[str] = None
        notes: Optional[str] = None
        status: str  # "started", "completed"
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 only mentions retrieval with filtering, lacking details on permissions, rate limits, pagination, or what the return format looks like. For a read operation with multiple parameters, this is insufficient to guide the agent effectively.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for the agent to parse quickly.

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?

Given the tool's complexity (5 parameters, no output schema, and no annotations), the description is incomplete. It doesn't explain the return structure, potential errors, or how filtering interacts with the sibling tools. This leaves significant gaps for the agent to understand the tool's full behavior.

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%, with all parameters well-documented in the schema (e.g., ISO 8601 format for dates, enum values for task_scope). The description adds minimal value by mentioning 'optional filtering' but doesn't provide additional context beyond what the schema already specifies, so it meets the baseline.

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 verb 'retrieve' and resource 'activity logs' with optional filtering, making the purpose understandable. However, it doesn't differentiate this tool from potential siblings like 'get_current_time' or 'get_elapsed_time' which might also retrieve time-related data, so it doesn't reach the highest score.

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 sibling tools like 'start_activity_log' or 'end_activity_log' for creating logs, or explain scenarios where filtering logs is preferred over other time-related queries. This leaves the agent without context for tool selection.

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/n0zer0d4y/chronos-protocol'

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