update_activity_log
Modify existing activity logs in Chronos Protocol to track progress, update task details, and maintain traceability for AI coding sessions.
Instructions
Update an existing activity log
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activityId | Yes | Unique identifier of the activity log to update | |
| activityType | No | Updated activity type | |
| description | No | Updated description | |
| notes | No | Updated traceability notes for session continuity and auditability. Document progress, changes in approach, new findings, or corrections made. Include specific details about what was modified, why changes were needed, and any insights gained. This ensures other AI agents can follow your thought process, understand context, and continue work seamlessly without losing critical information. | |
| result | No | Updated result | |
| tags | No | Updated tags | |
| task_scope | No | Updated task scope |
Implementation Reference
- src/chronos_protocol/server.py:529-549 (handler)Core handler function in TimeServer class that validates the activity log exists, filters and processes updates (handling TaskScope enums and None values), persists the update via database, retrieves the updated data, and returns an ActivityLog model instance.def update_activity_log(self, activity_id: str, updates: Dict[str, Any]) -> ActivityLog: """Update an existing activity log""" log_data = self.db.get_activity_log(activity_id) if not log_data: raise ValueError(f"Activity log with ID {activity_id} not found") # Filter out None values and convert enum values to strings filtered_updates = {} for key, value in updates.items(): if value is not None: if isinstance(value, TaskScope): filtered_updates[key] = value.value else: filtered_updates[key] = value self.db.update_activity_log(activity_id, filtered_updates) # Return updated log updated_log_data = self.db.get_activity_log(activity_id) return ActivityLog(**updated_log_data)
- src/chronos_protocol/server.py:771-810 (registration)Tool registration within the @server.list_tools() handler, defining the tool name, description, and detailed input schema including all updatable fields with descriptions.Tool( name=TimeTools.UPDATE_ACTIVITY_LOG.value, description="Update an existing activity log", inputSchema={ "type": "object", "properties": { "activityId": { "type": "string", "description": "Unique identifier of the activity log to update", }, "activityType": { "type": "string", "description": "Updated activity type", }, "task_scope": { "type": "string", "enum": [scope.value for scope in TaskScope], "description": "Updated task scope", }, "description": { "type": "string", "description": "Updated description", }, "tags": { "type": "array", "items": {"type": "string"}, "description": "Updated tags", }, "result": { "type": "string", "description": "Updated result", }, "notes": { "type": "string", "description": "Updated traceability notes for session continuity and auditability. Document progress, changes in approach, new findings, or corrections made. Include specific details about what was modified, why changes were needed, and any insights gained. This ensures other AI agents can follow your thought process, understand context, and continue work seamlessly without losing critical information.", }, }, "required": ["activityId"], }, ),
- src/chronos_protocol/server.py:915-925 (handler)Dispatch handler in _execute_tool that validates activityId argument, constructs updates dict from input args, and invokes the TimeServer handler.case TimeTools.UPDATE_ACTIVITY_LOG.value: activity_id = arguments.get("activityId") if not activity_id: raise ValueError("Missing required argument: activityId") updates = {} for key in ["activityType", "task_scope", "description", "tags", "result", "notes"]: if key in arguments: updates[key] = arguments[key] result = time_server.update_activity_log(activity_id, updates)
- Database storage helper that finds the activity log by ID, applies updates in-place to the JSON data structure, saves to file, and returns success boolean.def update_activity_log(self, activity_id: str, updates: Dict[str, Any]): """Update an existing activity log""" for log in self.activity_logs: if log.get('activityId') == activity_id: log.update(updates) self.save_data() return True return False
- Pydantic model defining the structure and types for activity log entries, used for input validation, serialization, and return type of the update handler.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"