1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
//! Typed parameter schemas for the MCP tools. Each derives `JsonSchema` (for the
//! tool `inputSchema`) and `Deserialize` (rmcp deserializes the call arguments
//! into these). Shared across the tool slices (`read`/`guide`/`lifecycle`), so
//! both the structs and their fields are `pub(crate)`.
use schemars::JsonSchema;
use serde::Deserialize;
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct ListParams {
/// Absolute path of the target git repo/project. Omit to use the launch dir.
pub(crate) project_path: Option<String>,
/// List tasks across all projects instead of just the current one.
pub(crate) all: Option<bool>,
/// Explicit project name filter (overrides project_path detection).
pub(crate) project: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct IdParams {
pub(crate) project_path: Option<String>,
/// Task id or (preferred) 8-char uuid prefix.
pub(crate) id: String,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct AddParams {
pub(crate) project_path: Option<String>,
/// The task description / title.
pub(crate) description: String,
pub(crate) project: Option<String>,
/// Priority: H, M, or L.
pub(crate) priority: Option<String>,
pub(crate) tags: Option<Vec<String>>,
/// Recurrence interval: daily, weekly, 2w, 3d, 1m, …
pub(crate) recur: Option<String>,
/// Notes to attach at creation.
pub(crate) annotations: Option<Vec<String>>,
/// URLs to link at creation.
pub(crate) links: Option<Vec<String>>,
/// Checklist steps to add at creation.
pub(crate) checks: Option<Vec<String>>,
/// UUID prefixes of tasks this new task depends on.
pub(crate) depends_on: Option<Vec<String>>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct StepsParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// Only return steps 1..=until.
pub(crate) until: Option<usize>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct StepDoneParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// 1-based step number.
pub(crate) n: usize,
/// Execution result / evidence recorded with the step.
pub(crate) result: Option<String>,
/// Item kind: "step" (default) or "acceptance".
pub(crate) kind: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct VerifyParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// Only return the verify command for step N.
pub(crate) step: Option<usize>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct RecallParams {
pub(crate) project_path: Option<String>,
/// Search query (keyword / FTS).
pub(crate) query: String,
/// Max results (default 20).
pub(crate) limit: Option<i64>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct AnnotateParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// The note / comment text.
pub(crate) text: String,
/// Note kind: comment (default), finding, decision, constraint, risk, …
pub(crate) kind: Option<String>,
/// Author: human (default) or ai.
pub(crate) author: Option<String>,
/// Anchor to a guide element: step:N, acceptance:N, anchor:ID, note:ID.
pub(crate) on: Option<String>,
/// Flag the anchored element for reconsideration.
pub(crate) reconsider: Option<bool>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct PlanImportParams {
pub(crate) project_path: Option<String>,
/// The plan graph as a JSON string ({"project"?, "tasks":[…]}). Passed inline
/// (never via stdin, which is the MCP transport channel).
pub(crate) plan_json: String,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct DoneParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// Complete the task even if it is blocked by unfinished dependencies.
pub(crate) force: Option<bool>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct LinkParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// The URL to attach (e.g. a PR or issue link).
pub(crate) url: String,
/// Optional human-readable label for the link.
pub(crate) label: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct DepParams {
pub(crate) project_path: Option<String>,
/// The dependent task (the one that gets blocked).
pub(crate) id: String,
/// "on" (add: `id` depends on `other`), "off" (remove), or "list".
pub(crate) action: String,
/// The blocker task; required for "on"/"off", ignored for "list".
pub(crate) other: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct CheckParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// The step / acceptance-criterion text.
pub(crate) text: String,
/// Item kind: "step" (default) or "acceptance".
pub(crate) kind: Option<String>,
/// Optional intent / why-note for the step.
pub(crate) intent: Option<String>,
/// Optional shell command that verifies this step.
pub(crate) verify: Option<String>,
/// Author/source of the item: "human" (default) or "ai".
pub(crate) source: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct ModifyParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// New description / title.
pub(crate) description: Option<String>,
/// Priority: H, M, or L.
pub(crate) priority: Option<String>,
/// Due date (same formats as `add`, e.g. "friday", "2026-07-15").
pub(crate) due: Option<String>,
/// Clear the due date.
pub(crate) clear_due: Option<bool>,
/// Tags — REPLACES the whole tag set (not additive).
pub(crate) tags: Option<Vec<String>>,
/// Clear all tags.
pub(crate) clear_tags: Option<bool>,
/// Time estimate, e.g. "90m", "2h", "2h30m".
pub(crate) estimate: Option<String>,
/// Clear the time estimate.
pub(crate) clear_estimate: Option<bool>,
/// Recurrence interval: daily, weekly, monthly, 2w, 3d, 1m, etc.
pub(crate) every: Option<String>,
/// Clear the recurrence interval.
pub(crate) clear_recur: Option<bool>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct ResolveParams {
pub(crate) project_path: Option<String>,
/// The feedback (annotation) id to resolve — NOT a task id/uuid.
pub(crate) feedback_id: i64,
/// Link this resolution to an AI run id (from `record_run`) that addressed it.
pub(crate) run_id: Option<i64>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct RecordRunParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// What the AI did, e.g. enrich, refine, implement, review.
pub(crate) kind: String,
/// Model used, e.g. claude-sonnet-5-thinking-high.
pub(crate) model: Option<String>,
/// Provider/platform, e.g. cursor.
pub(crate) provider: Option<String>,
/// The prompt/instruction given to the model (stored, not displayed in `sara info`).
pub(crate) prompt: Option<String>,
/// A summary of the model's response (stored, not displayed in `sara info`).
pub(crate) response: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct StepEditParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// 1-based step number.
pub(crate) n: usize,
/// Item kind: "step" (default) or "acceptance".
pub(crate) kind: Option<String>,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct GuideTextParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// The text to set (assignment / rationale).
pub(crate) text: String,
}
#[derive(Debug, Deserialize, JsonSchema)]
pub(crate) struct AttachParams {
pub(crate) project_path: Option<String>,
pub(crate) id: String,
/// File path or URL to attach. URLs are stored as links.
pub(crate) path: String,
/// Why this file/anchor matters.
pub(crate) reason: Option<String>,
/// Symbol (function/type) the anchor points at.
pub(crate) symbol: Option<String>,
/// Line range, e.g. "10:57" or "10-57".
pub(crate) lines: Option<String>,
/// Provenance: "ai" marks it suggested; anything else is manual.
pub(crate) source: Option<String>,
}