MCPcopy Create free account
hub / github.com/dexwritescode/rust-mcp / create_module_impl

Function create_module_impl

src/tools/advanced.rs:68–100  ·  view source on GitHub ↗
(
    args: Value,
    analyzer: &mut RustAnalyzerClient,
)

Source from the content-addressed store, hash-verified

66}
67
68pub async fn create_module_impl(
69 args: Value,
70 analyzer: &mut RustAnalyzerClient,
71) -> Result<ToolResult> {
72 let module_name = args
73 .get("module_name")
74 .and_then(|v| v.as_str())
75 .ok_or_else(|| anyhow::anyhow!("Missing module_name parameter"))?;
76 let module_path = args
77 .get("module_path")
78 .and_then(|v| v.as_str())
79 .ok_or_else(|| anyhow::anyhow!("Missing module_path parameter"))?;
80 let is_public = args
81 .get("is_public")
82 .and_then(|v| v.as_bool())
83 .unwrap_or(false);
84
85 let result = analyzer
86 .create_module(module_name, module_path, is_public)
87 .await?;
88
89 Ok(ToolResult {
90 content: vec![
91 json!({
92 "type": "text",
93 "text": result
94 })
95 .as_object()
96 .unwrap()
97 .clone(),
98 ],
99 })
100}
101
102pub async fn move_items_impl(args: Value, analyzer: &mut RustAnalyzerClient) -> Result<ToolResult> {
103 let source_file = args

Callers 1

execute_toolFunction · 0.85

Calls 1

create_moduleMethod · 0.45

Tested by

no test coverage detected