MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / call_in_process_tool

Function call_in_process_tool

src/tool_command.rs:220–260  ·  view source on GitHub ↗
(
    handshake: &DaemonHandshake,
    tool_name: &str,
    tool_args: Value,
)

Source from the content-addressed store, hash-verified

218}
219
220async fn call_in_process_tool(
221 handshake: &DaemonHandshake,
222 tool_name: &str,
223 tool_args: Value,
224) -> Result<Value> {
225 let project_path = handshake
226 .project_path
227 .as_ref()
228 .ok_or_else(|| TraceDecayError::Config {
229 message: "profile-scoped daemon tool dispatch requires daemon socket support"
230 .to_string(),
231 })?;
232 let open_options = tracedecay::tracedecay::TraceDecayOpenOptions {
233 profile_root: Some(handshake.client_identity.profile_root.clone()),
234 global_db_path: Some(handshake.client_identity.global_db_path.clone()),
235 };
236 let cg = if handshake.allow_init
237 && !tracedecay::tracedecay::TraceDecay::has_initialized_store_with_options(
238 project_path,
239 &open_options,
240 )
241 .await
242 {
243 tracedecay::tracedecay::TraceDecay::init_with_options(project_path, open_options).await?
244 } else {
245 tracedecay::tracedecay::TraceDecay::open_with_options(project_path, open_options).await?
246 };
247 let global_db =
248 tracedecay::global_db::GlobalDb::open_at(&handshake.client_identity.global_db_path).await;
249 let result = tracedecay::mcp::tools::handle_tool_call_with_registry(
250 &cg,
251 tool_name,
252 tool_args,
253 None,
254 handshake.scope_prefix.as_deref(),
255 global_db.as_ref(),
256 false,
257 )
258 .await?;
259 Ok(result.value)
260}
261
262async fn dispatch_daemon_tool(
263 dispatch: DaemonToolDispatch,

Callers 2

callMethod · 0.85
fallbackMethod · 0.85

Calls 1

Tested by

no test coverage detected