MCPcopy Index your code
hub / github.com/InfinitiBit/graphbit / get_tool_metadata

Method get_tool_metadata

python/src/tools/registry.rs:200–219  ·  view source on GitHub ↗

Get tool metadata

(&self, name: &str)

Source from the content-addressed store, hash-verified

198
199 /// Get tool metadata
200 pub fn get_tool_metadata(&self, name: &str) -> PyResult<Option<String>> {
201 let metadata = self.metadata.read().map_err(|e| {
202 PyErr::new::<pyo3::exceptions::PyRuntimeError, _>(format!(
203 "Failed to acquire metadata lock: {}",
204 e
205 ))
206 })?;
207
208 if let Some(meta) = metadata.get(name) {
209 let json = serde_json::to_string(meta).map_err(|e| {
210 PyErr::new::<pyo3::exceptions::PyValueError, _>(format!(
211 "Failed to serialize metadata: {}",
212 e
213 ))
214 })?;
215 Ok(Some(json))
216 } else {
217 Ok(None)
218 }
219 }
220
221 /// Get all tools as LlmTool format for agent integration
222 pub fn get_llm_tools(&self) -> PyResult<Vec<String>> {

Calls 1

getMethod · 0.45