def METHOD_NAME(yml_data: Dict, command_name: str, output_with_contexts: List):
    """Insert new outputs for a command in the yml_data and return it.
    Args:
        yml_data: yaml as python dict.
        command_name: the command name whose outputs we want to manipulate.
        output_with_contexts: the new outputs.
    """
    commands = yml_data.get("script", {}).get("commands") or []
    command_names = [command.get("name") for command in commands]
    if command_name not in command_names:
        raise ValueError(
            f"The {command_name} command is missing from the integration YML."
        )
    command_index = command_names.index(command_name)
    command = commands[command_index]
    outputs: List[Dict[str, str]] = command.get("outputs") or []
    old_descriptions = _output_path_to_description(outputs)
    new_descriptions = _output_path_to_description(output_with_contexts)
    old_output_paths = {
        output.get("contextPath") for output in command.get("outputs", [])
    }
    outputs.extend(
        output
        for output in output_with_contexts
        if output.get("contextPath")
        and output.get("contextPath") not in old_output_paths
    )
    # populates the description field, preferring the new value (if not blank), and existing values over blanks.
    for output in outputs:
        path = output.get("contextPath")
        if not path:
            raise ValueError("Found a command without a contextPath value")
        if not output.get("description"):
            output["description"] = (
                new_descriptions.get(path) or old_descriptions.get(path) or ""
            )
    yml_data["script"]["commands"][command_index]["outputs"] = outputs
    return yml_data