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"

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