Agent Prompt Templates¶
For agents to use OpenTime proactively (without being asked), add instructions to the agent's system prompt.
Usage¶
from opentime.prompts import get_system_prompt
# For MCP-connected agents
prompt = get_system_prompt("mcp")
# For OpenAI / Gemini function calling
prompt = get_system_prompt("openai")
# For REST API agents
prompt = get_system_prompt("rest_api", base_url="http://localhost:8080")
Then append it to your agent's system prompt:
Available Modes¶
| Mode | Aliases | For |
|---|---|---|
"mcp" |
— | Claude Code, Cursor, Windsurf, Cline, etc. |
"function_calling" |
"openai", "gemini" |
OpenAI GPT-4, Gemini |
"rest_api" |
"rest" |
Any HTTP-based agent |
What the Prompt Instructs¶
The template tells the agent to:
- Always track tasks — Call task_start/task_end on every task with correlation IDs
- Use descriptive task types — Consistent names like
"code_generation","debugging" - Check before setting timeouts — Use recommend_timeout for data-driven values
- Compare approaches by time — Use compare_approaches instead of guessing
- Monitor active tasks — Check active_tasks periodically
- Track everything — Not just coding, but downloads, tests, builds, searches
Manual Copy-Paste¶
If you can't call get_system_prompt() programmatically, here's the core text to add to any agent's instructions:
You have access to OpenTime time tracking tools. Use them proactively on EVERY task:
- Call task_start at the beginning of every task — save the correlation_id.
- Call task_end when done — pass the correlation_id.
- Before setting timeouts, call recommend_timeout.
- When choosing between approaches, call compare_approaches.
- Use consistent task_type names (e.g. "code_generation", "debugging", "test_run").
Do NOT wait to be asked — track time automatically on all tasks.