pub struct GraphTools { /* private fields */ }Expand description
MCP tools for graph queries.
Generates eight tools:
graph_related— find related nodesgraph_path— shortest path between nodesgraph_prerequisites— learning order prerequisitesgraph_neighborhood— N-hop neighborhood explorationgraph_info— graph statisticsgraph_validate— structure validationgraph_centrality— most central/important nodesgraph_bridges— bridge nodes connecting different areas
§Example
ⓘ
use fabryk_graph::GraphData;
use fabryk_mcp_graph::GraphTools;
let graph = fabryk_graph::load_graph("graph.json")?;
let graph_tools = GraphTools::new(graph);Implementations§
Source§impl GraphTools
impl GraphTools
Sourcepub const SLOT_RELATED: &str = "graph_related"
pub const SLOT_RELATED: &str = "graph_related"
Slot key for the related nodes tool.
Sourcepub const SLOT_PREREQUISITES: &str = "graph_prerequisites"
pub const SLOT_PREREQUISITES: &str = "graph_prerequisites"
Slot key for the prerequisites tool.
Sourcepub const SLOT_NEIGHBORHOOD: &str = "graph_neighborhood"
pub const SLOT_NEIGHBORHOOD: &str = "graph_neighborhood"
Slot key for the neighborhood tool.
Sourcepub const SLOT_VALIDATE: &str = "graph_validate"
pub const SLOT_VALIDATE: &str = "graph_validate"
Slot key for the validation tool.
Sourcepub const SLOT_CENTRALITY: &str = "graph_centrality"
pub const SLOT_CENTRALITY: &str = "graph_centrality"
Slot key for the centrality tool.
Sourcepub const SLOT_BRIDGES: &str = "graph_bridges"
pub const SLOT_BRIDGES: &str = "graph_bridges"
Slot key for the bridges tool.
Create graph tools with a shared graph reference.
Sourcepub fn with_names(self, names: HashMap<String, String>) -> Self
pub fn with_names(self, names: HashMap<String, String>) -> Self
Override tool names by slot key.
Sourcepub fn with_descriptions(self, descriptions: HashMap<String, String>) -> Self
pub fn with_descriptions(self, descriptions: HashMap<String, String>) -> Self
Override tool descriptions by slot key.
Sourcepub async fn update_graph(&self, graph: GraphData)
pub async fn update_graph(&self, graph: GraphData)
Update the graph data (e.g., after rebuild).
Trait Implementations§
Source§impl ToolRegistry for GraphTools
impl ToolRegistry for GraphTools
Auto Trait Implementations§
impl Freeze for GraphTools
impl !RefUnwindSafe for GraphTools
impl Send for GraphTools
impl Sync for GraphTools
impl Unpin for GraphTools
impl UnsafeUnpin for GraphTools
impl !UnwindSafe for GraphTools
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more