Skip to main content
Glama

semantic-edit-mcp

by jbr
set_working_directory.rs1.15 kB
use crate::state::SemanticEditTools; use anyhow::Result; use mcplease::{ traits::{Tool, WithExamples}, types::Example, }; use serde::{Deserialize, Serialize}; /// Set the working context path for a session #[derive(Serialize, Deserialize, Debug, schemars::JsonSchema, clap::Args)] #[serde(rename = "set_working_directory")] #[group(skip)] pub struct SetWorkingDirectory { /// New working directory. All relative paths will be relative to this path path: String, } impl WithExamples for SetWorkingDirectory { fn examples() -> Vec<Example<Self>> { vec![Example { description: "setting context to a development project", item: Self { path: "/usr/local/projects/cobol".into(), }, }] } } impl Tool<SemanticEditTools> for SetWorkingDirectory { fn execute(self, state: &mut SemanticEditTools) -> Result<String> { let new_context_path = state.resolve_path(&self.path, None)?; let response = format!("Set context to {}", new_context_path.display()); state.set_working_directory(new_context_path, None)?; Ok(response) } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jbr/semantic-edit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server