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)
| 253 | |
| 254 | |
| 255 | def _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 | |
| 267 | def _int_arg( |