diff --git a/server/src/http/mcp/mod.rs b/server/src/http/mcp/mod.rs index 8a31ff0c..ed95be25 100644 --- a/server/src/http/mcp/mod.rs +++ b/server/src/http/mcp/mod.rs @@ -334,6 +334,10 @@ fn handle_tools_list(id: Option) -> JsonRpcResponse { "type": "string", "description": "Optional user story text (As a..., I want..., so that...)" }, + "description": { + "type": "string", + "description": "Optional description / background context for the story" + }, "acceptance_criteria": { "type": "array", "items": { "type": "string" }, diff --git a/server/src/http/mcp/story_tools.rs b/server/src/http/mcp/story_tools.rs index 2a16ed45..f817be38 100644 --- a/server/src/http/mcp/story_tools.rs +++ b/server/src/http/mcp/story_tools.rs @@ -20,6 +20,7 @@ pub(super) fn tool_create_story(args: &Value, ctx: &AppContext) -> Result> = args .get("acceptance_criteria") .and_then(|v| serde_json::from_value(v.clone()).ok()); @@ -35,6 +36,7 @@ pub(super) fn tool_create_story(args: &Value, ctx: &AppContext) -> Result, + description: Option<&str>, acceptance_criteria: Option<&[String]>, depends_on: Option<&[u32]>, _commit: bool, @@ -45,6 +46,13 @@ pub fn create_story_file( } content.push('\n'); + if let Some(desc) = description { + content.push_str("## Description\n\n"); + content.push_str(desc); + content.push('\n'); + content.push('\n'); + } + content.push_str("## Acceptance Criteria\n\n"); if let Some(criteria) = acceptance_criteria { for criterion in criteria { @@ -350,7 +358,7 @@ mod tests { fn create_story_with_colon_in_name_produces_valid_yaml() { let tmp = tempfile::tempdir().unwrap(); let name = "Server-owned agent completion: remove report_completion dependency"; - let result = create_story_file(tmp.path(), name, None, None, None, false); + let result = create_story_file(tmp.path(), name, None, None, None, None, false); assert!(result.is_ok(), "create_story_file failed: {result:?}"); let story_id = result.unwrap(); @@ -622,6 +630,7 @@ mod tests { "Dependent Story", None, None, + None, Some(&[489]), false, )