MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / extract_json

Function extract_json

tests/mcp_suite/git_correlation_test.rs:112–117  ·  view source on GitHub ↗
(result: &tracedecay::mcp::ToolResult)

Source from the content-addressed store, hash-verified

110}
111
112fn extract_json(result: &tracedecay::mcp::ToolResult) -> Value {
113 let text = result.value["content"][0]["text"]
114 .as_str()
115 .unwrap_or_else(|| panic!("tool result should carry text content: {}", result.value));
116 serde_json::from_str(text).unwrap_or_else(|e| panic!("tool result should be JSON: {e}\n{text}"))
117}
118
119async fn call(cg: &TraceDecay, tool: &str, mut args: Value) -> Value {
120 if let Some(obj) = args.as_object_mut() {

Callers 1

callFunction · 0.70

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected