MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _node_arg

Function _node_arg

graphify/serve.py:255–264  ·  view source on GitHub ↗

The node identifier a lookup tool was called with. ``get_node``/``get_neighbors`` historically read ``arguments["label"]`` only, so a client that passes the node under ``node_id`` (or ``id``) — several of the agent frameworks graphify targets do — raised ``KeyError('label')`` instead of

(arguments: dict)

Source from the content-addressed store, hash-verified

253
254
255def _node_arg(arguments: dict) -> str:
256 """The node identifier a lookup tool was called with.
257
258 ``get_node``/``get_neighbors`` historically read ``arguments["label"]`` only, so a client that
259 passes the node under ``node_id`` (or ``id``) — several of the agent frameworks graphify targets
260 do — raised ``KeyError('label')`` instead of being served. Accept the common spellings; callers
261 treat an empty string as "no identifier given" and answer with guidance rather than a traceback.
262 """
263 v = arguments.get("label") or arguments.get("node_id") or arguments.get("id") or ""
264 return v if isinstance(v, str) else str(v)
265
266
267def _int_arg(

Callers 4

_tool_get_nodeFunction · 0.85
_tool_get_sectionFunction · 0.85
_tool_get_neighborsFunction · 0.85

Calls 1

getMethod · 0.45