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

Method exec_kg_search

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

Source from the content-addressed store, hash-verified

865 }
866
867 fn exec_kg_search(&self, args: &serde_json::Value) -> Result<String, String> {
868 let query = args["query"]
869 .as_str()
870 .ok_or("missing required parameter: query")?;
871 let limit = args["limit"].as_u64().unwrap_or(10) as usize;
872
873 // Scoped to the desired view: VCS nodes and source content are
874 // filtered by the view's closure, while vault-only nodes stay shared.
875 let view = self
876 .desired_view()
877 .map_err(|e| format!("kg_search failed: {e}"))?;
878 let nodes = self
879 .repo
880 .vault_kg_search_on_view(&view, query, limit, None)
881 .map_err(|e| format!("kg_search failed: {e}"))?;
882
883 serde_json::to_string_pretty(&nodes).map_err(|e| format!("serialize error: {e}"))
884 }
885
886 fn exec_kg_neighbors(&self, args: &serde_json::Value) -> Result<String, String> {
887 let node_id = args["node_id"]

Callers 1

executeMethod · 0.80

Calls 4

as_u64Method · 0.80
desired_viewMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected