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

Method first_node_id

benchmarks/run_benchmarks.py:263–272  ·  view source on GitHub ↗

Extract the first node id from a tracedecay_search response.

(search_resp: dict)

Source from the content-addressed store, hash-verified

261
262 @staticmethod
263 def first_node_id(search_resp: dict) -> str | None:
264 """Extract the first node id from a tracedecay_search response."""
265 try:
266 text = search_resp["result"]["content"][0]["text"]
267 items = json.loads(text)
268 if isinstance(items, list) and items:
269 return items[0].get("id")
270 except (KeyError, IndexError, TypeError, json.JSONDecodeError):
271 return None
272 return None
273
274
275def benchmark_tracedecay(name: str, root: Path, sample_symbols: list[str]) -> dict:

Callers 1

benchmark_tracedecayFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected