Skip to main content

aster/agents/
platform_tools.rs

1use indoc::indoc;
2use rmcp::model::{Tool, ToolAnnotations};
3use rmcp::object;
4pub const PLATFORM_MANAGE_SCHEDULE_TOOL_NAME: &str = "platform__manage_schedule";
5
6pub fn manage_schedule_tool() -> Tool {
7    Tool::new(
8        PLATFORM_MANAGE_SCHEDULE_TOOL_NAME.to_string(),
9        indoc! {r#"
10            Manage scheduled recipe execution for this aster instance.
11            
12            Actions:
13            - "list": List all scheduled jobs
14            - "create": Create a new scheduled job from a recipe file
15            - "run_now": Execute a scheduled job immediately  
16            - "pause": Pause a scheduled job
17            - "unpause": Resume a paused job
18            - "delete": Remove a scheduled job
19            - "kill": Terminate a currently running job
20            - "inspect": Get details about a running job
21            - "sessions": List execution history for a job
22            - "session_content": Get the full content (messages) of a specific session
23        "#}
24        .to_string(),
25        object!({
26            "type": "object",
27            "required": ["action"],
28            "properties": {
29                "action": {
30                    "type": "string",
31                    "enum": ["list", "create", "run_now", "pause", "unpause", "delete", "kill", "inspect", "sessions", "session_content"]
32                },
33                "job_id": {"type": "string", "description": "Job identifier for operations on existing jobs"},
34                "recipe_path": {"type": "string", "description": "Path to recipe file for create action"},
35                "cron_expression": {"type": "string", "description": "A cron expression for create action. Supports both 5-field (minute hour day month weekday) and 6-field (second minute hour day month weekday) formats. 5-field expressions are automatically converted to 6-field by prepending '0' for seconds."},
36                "limit": {"type": "integer", "description": "Limit for sessions list", "default": 50},
37                "session_id": {"type": "string", "description": "Session identifier for session_content action"}
38            }
39        }),
40    ).annotate(ToolAnnotations {
41        title: Some("Manage scheduled recipes".to_string()),
42        read_only_hint: Some(false),
43        destructive_hint: Some(true), // Can kill jobs
44        idempotent_hint: Some(false),
45        open_world_hint: Some(false),
46    })
47}