INNER CODE UNIT · Python
find_by_python_name
viticci/shortcuts-playground-plugin · claude/skills/shortcuts-playground/scripts/lookup_action_grounding.py:220
def find_by_python_name(catalog: dict[str, Any], value: str) -> tuple[str, dict[str, Any]] | None:
lookup = catalog.get("pythonLookup") or {}
if value in lookup:
entry = lookup[value]
identifier = entry.get("wfIdentifier")
if identifier:
found = find_by_identifier(catalog, identifier)
return found or (identifier, entry)
for identifier, entry in (catalog.get("tools") or {}).items():
if entry.get("pythonName") == value:
return identifier, entry
return None
def parameter_entry_to_grounding(identifier: str, entry: dict[str, Any]) -> dict[str, Any]:
return {
"status": "toolkit-parameter-summary",
"name": entry.get("displayName") or identifier,