diff --git a/crates/goose-mcp/src/computercontroller/mod.rs b/crates/goose-mcp/src/computercontroller/mod.rs index ec8d5f61..7bd647e2 100644 --- a/crates/goose-mcp/src/computercontroller/mod.rs +++ b/crates/goose-mcp/src/computercontroller/mod.rs @@ -24,7 +24,6 @@ use mcp_server::Router; mod docx_tool; mod pdf_tool; -mod presentation_tool; mod xlsx_tool; mod platform; @@ -363,47 +362,6 @@ impl ComputerControllerRouter { None, ); - let make_presentation_tool = Tool::new( - "make_presentation", - indoc! {r#" - Create and manage HTML presentations with a simple, modern design. - Operations: - - create: Create new presentation with template - - add_slide: Add a new slide with content - - Open in a browser (using a command) to show the user: open - - For advanced edits, use developer tools to modify the HTML directly. - A template slide is included in comments for reference. - "#}, - json!({ - "type": "object", - "required": ["path", "operation"], - "properties": { - "path": { - "type": "string", - "description": "Path to the presentation file" - }, - "operation": { - "type": "string", - "enum": ["create", "add_slide"], - "description": "Operation to perform" - }, - "params": { - "type": "object", - "description": "Parameters for add_slide operation", - "properties": { - "content": { - "type": "string", - "description": "Content for the new slide" - } - } - } - } - }), - None, - ); - let xlsx_tool = Tool::new( "xlsx_tool", indoc! {r#" @@ -593,7 +551,6 @@ impl ComputerControllerRouter { pdf_tool, docx_tool, xlsx_tool, - make_presentation_tool, ], cache_dir, active_resources: Arc::new(Mutex::new(HashMap::new())), @@ -1168,24 +1125,6 @@ impl Router for ComputerControllerRouter { "pdf_tool" => this.pdf_tool(arguments).await, "docx_tool" => this.docx_tool(arguments).await, "xlsx_tool" => this.xlsx_tool(arguments).await, - "make_presentation" => { - let path = arguments - .get("path") - .and_then(|v| v.as_str()) - .ok_or_else(|| { - ToolError::InvalidParameters("Missing 'path' parameter".into()) - })?; - - let operation = arguments - .get("operation") - .and_then(|v| v.as_str()) - .ok_or_else(|| { - ToolError::InvalidParameters("Missing 'operation' parameter".into()) - })?; - - presentation_tool::make_presentation(path, operation, arguments.get("params")) - .await - } _ => Err(ToolError::NotFound(format!("Tool {} not found", tool_name))), } }) diff --git a/crates/goose-mcp/src/computercontroller/presentation_tool.rs b/crates/goose-mcp/src/computercontroller/presentation_tool.rs deleted file mode 100644 index 26e5e550..00000000 --- a/crates/goose-mcp/src/computercontroller/presentation_tool.rs +++ /dev/null @@ -1,398 +0,0 @@ -use mcp_core::{Content, ToolError}; -use serde_json::Value; -use std::fs; - -const TEMPLATE: &str = r#" - - HTML and CSS Slideshow - - - - -
-
- -
-

Your Presentation

-

Use arrow keys to navigate

-
- - - - -
-
- - - - - -"#; - -pub async fn make_presentation( - path: &str, - operation: &str, - params: Option<&Value>, -) -> Result, ToolError> { - match operation { - "create" => { - // Get title from params or use default - let title = params - .and_then(|p| p.get("title")) - .and_then(|v| v.as_str()) - .unwrap_or("Your Presentation"); - - // Replace title in template - let content = TEMPLATE.replace("Your Presentation", title); - - // Create a new presentation with the template - fs::write(path, content).map_err(|e| { - ToolError::ExecutionError(format!("Failed to create presentation file: {}", e)) - })?; - - Ok(vec![Content::text(format!( - "Created new presentation with title '{}' at: {}\nYou can open it with the command: `open {}` to show user. You should look at the html and consider if you want to ask user if they need to adjust it, colours, typeface and so on.", - title, path, path - ))]) - } - "add_slide" => { - let content = params - .and_then(|p| p.get("content")) - .and_then(|v| v.as_str()) - .ok_or_else(|| { - ToolError::InvalidParameters("Missing 'content' parameter for slide".into()) - })?; - - // Read existing file - let mut html = fs::read_to_string(path).map_err(|e| { - ToolError::ExecutionError(format!("Failed to read presentation file: {}", e)) - })?; - - // Find the marker comment - let marker = "