agent_state_log_message
Append messages to a log file for tracking AI agent progress and maintaining event history across sessions, ensuring continuity when agents are interrupted and resumed.
Instructions
Append a message to the log file.
Args: directory: Absolute path to the GitHub worktree or repository directory where the log file should be saved message: The message to append to the log
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory | Yes | ||
| message | Yes |
Implementation Reference
- main.py:113-124 (handler)The implementation of the agent_state_log_message tool, which appends a message to the .agent-log.txt file in the specified directory.
def agent_state_log_message(directory: str, message: str) -> None: """Append a message to the log file. Args: directory: Absolute path to the GitHub worktree or repository directory where the log file should be saved message: The message to append to the log """ log_file = get_log_file(directory) with log_file.open("a", encoding="utf-8") as f: f.write(f"{message}\n") - main.py:112-112 (registration)Registration of the agent_state_log_message tool using the @mcp.tool() decorator.
@mcp.tool()