Skip to main content
Glama

end_activity_log

Ends an activity log with system timestamp, calculates duration, and records results with detailed notes for traceability and session continuity.

Instructions

End an activity log with system timestamp and calculate duration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activityIdYesUnique identifier of the activity log to end
notesNoDetailed notes for traceability and session continuity. Include: what was accomplished, key decisions made, challenges encountered, solutions implemented, and any critical context for future reference. This enables other AI agents to understand your work, backtrack steps if issues arise, and continue development effectively. Be specific about code changes, architectural decisions, and debugging insights.
resultNoResult or outcome of the activity

Implementation Reference

  • Core handler function in TimeServer class that ends an activity log: validates existence and status, records end time, computes duration, updates database with result/notes/status, and returns the updated ActivityLog object.
    def end_activity_log(
        self,
        activity_id: str,
        result: Optional[str] = None,
        notes: Optional[str] = None
    ) -> ActivityLog:
        """End an activity log and calculate duration"""
        log_data = self.db.get_activity_log(activity_id)
        if not log_data:
            raise ValueError(f"Activity log with ID {activity_id} not found")
    
        if log_data['status'] == 'completed':
            raise ValueError(f"Activity log with ID {activity_id} is already completed")
        
        end_time = datetime.now(ZoneInfo('UTC')).isoformat(timespec="seconds")
        start_time = datetime.fromisoformat(log_data['startTime'].replace('Z', '+00:00'))
        end_dt = datetime.fromisoformat(end_time.replace('Z', '+00:00'))
        
        duration_seconds = int((end_dt - start_time).total_seconds())
        duration_str = format_duration(duration_seconds)
        
        updates = {
            'endTime': end_time,
            'duration': duration_str,
            'durationSeconds': duration_seconds,
            'result': result,
            'notes': notes,
            'status': 'completed'
        }
        
        self.db.update_activity_log(activity_id, updates)
    
        # Return updated log
        updated_log_data = self.db.get_activity_log(activity_id)
        return ActivityLog(**updated_log_data)
  • Tool registration in list_tools(): defines name 'end_activity_log', description, and input schema (activityId required, result/notes optional).
    Tool(
        name=TimeTools.END_ACTIVITY_LOG.value,
        description="End an activity log with system timestamp and calculate duration",
        inputSchema={
            "type": "object",
            "properties": {
                "activityId": {
                    "type": "string",
                    "description": "Unique identifier of the activity log to end",
                },
                "result": {
                    "type": "string",
                    "description": "Result or outcome of the activity",
                },
                "notes": {
                    "type": "string",
                    "description": "Detailed notes for traceability and session continuity. Include: what was accomplished, key decisions made, challenges encountered, solutions implemented, and any critical context for future reference. This enables other AI agents to understand your work, backtrack steps if issues arise, and continue development effectively. Be specific about code changes, architectural decisions, and debugging insights.",
                },
            },
            "required": ["activityId"],
        },
    ),
  • Dispatch/registration in _execute_tool(): pattern matches tool name and calls TimeServer.end_activity_log with parsed arguments.
    case TimeTools.END_ACTIVITY_LOG.value:
        activity_id = arguments.get("activityId")
        if not activity_id:
            raise ValueError("Missing required argument: activityId")
    
        result = time_server.end_activity_log(
            activity_id,
            arguments.get("result"),
            arguments.get("notes"),
        )
  • Pydantic schema/model for ActivityLog, used for input/output serialization and validation in end_activity_log and related operations.
    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"
  • Enum definition TimeTools.END_ACTIVITY_LOG providing the canonical tool name string.
    END_ACTIVITY_LOG = "end_activity_log"
Behavior2/5

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

With no annotations provided, the description carries full burden but only mentions timestamping and duration calculation. It doesn't disclose critical behavioral traits like whether this is a destructive operation, permission requirements, error handling, or how it interacts with other tools (e.g., if it closes a log started by 'start_activity_log').

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 front-loads the core purpose ('end an activity log') and key outcomes. There is no wasted verbiage, making it highly concise and well-structured.

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 complexity of ending an activity log with no annotations and no output schema, the description is incomplete. It lacks details on return values, error conditions, or how it integrates with sibling tools, leaving significant gaps for an AI agent to understand the full context.

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%, so the schema already documents all parameters. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain how 'notes' or 'result' affect the ending process), resulting in a baseline score of 3.

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 action ('end an activity log') and specifies key outcomes ('with system timestamp and calculate duration'), which distinguishes it from siblings like 'start_activity_log' or 'update_activity_log'. However, it doesn't explicitly differentiate from all siblings (e.g., 'update_activity_log' might also involve ending).

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 on when to use this tool versus alternatives like 'update_activity_log' or how it relates to sibling tools such as 'start_activity_log'. The description implies usage after starting an activity but lacks explicit context or exclusions.

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