From 5ed3b75f6b1814215d951cbc8cb97351d7cca9eb Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 11 Mar 2026 15:31:10 +1100 Subject: [PATCH] fix(mark): remove useless internal IDs from project MCP tool responses Strip repo_id from add_project_repo and session_id/artifact_id from start_repo_session responses since no exposed tool accepts these IDs, making them noise for the agent. Simplify add_project_repo responses to plain strings instead of JSON objects. Co-Authored-By: Claude Opus 4.6 --- apps/mark/src-tauri/src/project_mcp.rs | 32 +++++++------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/apps/mark/src-tauri/src/project_mcp.rs b/apps/mark/src-tauri/src/project_mcp.rs index 46c9846f..715e425a 100644 --- a/apps/mark/src-tauri/src/project_mcp.rs +++ b/apps/mark/src-tauri/src/project_mcp.rs @@ -458,7 +458,6 @@ impl ProjectToolsHandler { // after the parent project session has been cancelled. self.registry.cancel(&session_id); return serde_json::json!({ - "session_id": session_id, "outcome": "cancelled", "output": "", }) @@ -523,13 +522,9 @@ impl ProjectToolsHandler { None }; let mut result = serde_json::json!({ - "session_id": session_id, "outcome": outcome, "output": output, }); - if let Some(aid) = artifact_id.as_deref() { - result["artifact_id"] = serde_json::Value::String(aid.to_string()); - } if let Some(note) = note_info { result["note"] = serde_json::Value::String(note); } @@ -622,10 +617,7 @@ impl ProjectToolsHandler { "[project_mcp] add_project_repo: no branch found for repo {} after creation", github_repo ); - return format!( - r#"{{"repo_id": "{}", "message": "Added repository {} to project (no branch found)"}}"#, - repo.id, github_repo - ); + return format!("Added repository {github_repo} to project (no branch found)"); } }; @@ -660,21 +652,17 @@ impl ProjectToolsHandler { "[project_mcp] add_project_repo: worktree setup failed (continuing): {e}" ); // Don't abort — return the repo even if worktree setup failed - return serde_json::json!({ - "repo_id": repo.id, - "message": format!("Added repository {github_repo} to project (worktree setup failed: {e})"), - }) - .to_string(); + return format!( + "Added repository {github_repo} to project (worktree setup failed: {e})" + ); } Err(e) => { log::warn!( "[project_mcp] add_project_repo: worktree task panicked (continuing): {e}" ); - return serde_json::json!({ - "repo_id": repo.id, - "message": format!("Added repository {github_repo} to project (worktree task error: {e})"), - }) - .to_string(); + return format!( + "Added repository {github_repo} to project (worktree task error: {e})" + ); } } @@ -718,11 +706,7 @@ impl ProjectToolsHandler { } } - serde_json::json!({ - "repo_id": repo.id, - "message": format!("Added repository {github_repo} to project"), - }) - .to_string() + format!("Added repository {github_repo} to project") } }