agent_state_load_state
Load saved agent state from a file to resume work after interruption, using a directory path to locate the state file.
Instructions
Load the current agent state from the state file.
Args: directory: Absolute path to the GitHub worktree or repository directory where the state file is located
Returns: The current state string, or empty string if the file doesn't exist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory | Yes |
Implementation Reference
- main.py:94-109 (handler)The handler function `agent_state_load_state` registers the MCP tool and reads the agent state from the `.agent-state.txt` file in the specified directory.
@mcp.tool() def agent_state_load_state(directory: str) -> str: """Load the current agent state from the state file. Args: directory: Absolute path to the GitHub worktree or repository directory where the state file is located Returns: The current state string, or empty string if the file doesn't exist """ state_file = get_state_file(directory) if not state_file.exists(): return "" return state_file.read_text(encoding="utf-8")