Expand description
Cron MCP - durable scheduled prompts (mcp__forge__cron__*).
A forge cron fires a prompt into the session that owns it, on a
schedule, and survives forge restarts (persisted to the machine-local
redb store; see crate::store::cron). Unlike the cloud routines
(create_trigger /
CronCreate), which fire into cloud-hosted sessions, these durably
target the local forge process.
The tools (cron__create / cron__list / cron__delete) are
ANY-CALLER and owner-scoped: create stamps the caller as the new
entryβs owner, and list / delete narrow to the crons the caller
owns. Mirrors agents__list, not the lead-only agents__spawn.
Cron-list mutations are direct Workspace methods (state writes), not
Command-bus dispatches.
Re-exportsΒ§
use std::sync::Arc;πuse std::time::SystemTime;πuse forge_sdk::mcp::server::McpServerBuilder;πuse forge_sdk::mcp::tool::Tool;πuse forge_sdk::mcp::tool::ToolInput;πuse forge_sdk::mcp::tool::ToolOutput;πuse forge_primitives::cron::CronEntry;πuse forge_primitives::cron::CronId;πuse forge_primitives::cron::CronKind;πuse crate::SessionSlot;πuse crate::mcp::cron::facade::CronCreateError;πuse crate::mcp::cron::facade::CronDeleteError;πuse crate::mcp::cron::facade::CronFacade;πuse crate::mcp::cron::facade::CronListError;π
ModulesΒ§
- facade π
CronFacade- the seam between the cron MCP tools and workspace state. The production impl (ProdCronFacade) resolves the callerβs project and drives the directWorkspacecron methods; the mock records calls for tool tests.- schedule π
- Cron schedule math: expression parsing, next-fire, and due-check.
StructsΒ§
- Create π
- Create
Args π - Delete π
- Delete
Args π - List π
FunctionsΒ§
- add_
tools π - Attach the three cron-coordination tools to an existing
McpServerBuilder. Called for BOTH lead and worker sessions (crons are any-caller), sobuild_forge_serverinvokes this unconditionally. - cron_
to_ πjson - Readable JSON for one cron entry (the tool-output shape the LLM sees).
- fmt_
rfc3339 π - Format a
SystemTimeas a UTC RFC3339 string for tool output. - format_
create_ πerror - parse_
rfc3339 π - Parse an RFC3339 timestamp to a
SystemTimevia thetimecrate (chrono stays confined to the schedule module). - tool_
error π