Skip to main content

max / goingson

988 B · 32 lines History Blame Raw
1 //! Tool registration. Every GoingsOn operation is a kberg `Tool`; this module
2 //! wires them into a single `ToolRegistry`.
3
4 use std::sync::Arc;
5
6 use kberg::ToolRegistry;
7
8 use crate::context::Ctx;
9
10 mod project;
11 mod task;
12
13 pub use project::{CreateProject, ListProjects, UpdateProjectTool};
14 pub use task::{BulkImportTasks, CompleteTask, CreateTask, GetTask, ListTasks, UpdateTaskTool};
15
16 /// Build the full go-mcp tool surface over a shared context.
17 pub fn registry(ctx: Arc<Ctx>) -> ToolRegistry {
18 let mut r = ToolRegistry::new();
19 // Reads (small-model safe).
20 r.register(ListProjects(ctx.clone()));
21 r.register(ListTasks(ctx.clone()));
22 r.register(GetTask(ctx.clone()));
23 // Writes (capability-gated).
24 r.register(CreateProject(ctx.clone()));
25 r.register(UpdateProjectTool(ctx.clone()));
26 r.register(CreateTask(ctx.clone()));
27 r.register(BulkImportTasks(ctx.clone()));
28 r.register(UpdateTaskTool(ctx.clone()));
29 r.register(CompleteTask(ctx));
30 r
31 }
32