MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / exec_vault_read

Method exec_vault_read

atomic-repository/src/ai/tools.rs:1005–1022  ·  view source on GitHub ↗
(&self, args: &serde_json::Value)

Source from the content-addressed store, hash-verified

1003 }
1004
1005 fn exec_vault_read(&self, args: &serde_json::Value) -> Result<String, String> {
1006 let path = args["path"]
1007 .as_str()
1008 .ok_or("missing required parameter: path")?;
1009
1010 let entry = self
1011 .repo
1012 .vault_retrieve(path)
1013 .map_err(|e| format!("vault_read failed: {e}"))?;
1014
1015 match entry {
1016 Some(e) => {
1017 let text = String::from_utf8_lossy(&e.content_bytes).into_owned();
1018 Ok(text)
1019 }
1020 None => Err(format!("vault entry not found: {path}")),
1021 }
1022 }
1023
1024 fn exec_list_entities(&self, args: &serde_json::Value) -> Result<String, String> {
1025 let path_str = args["path"]

Callers 1

executeMethod · 0.80

Calls 2

vault_retrieveMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected