def METHOD_NAME(typ: str, params: List[str]) -> Tuple[str, List[str]]:
    if typ in scalars:
        return typ, params
    if typ not in types:
        raise InvalidJsonSchemaException(f"Unsupported type: {typ}")
    def _err(expected_num_params: int, exact: bool = False):
        raise ArgumentMismatchException(typ, len(params), expected_num_params, exact)
    if typ == "Any":
        if params:
            _err(0)
    elif typ == "Optional":
        if len(params) > 1:
            _err(1)
    elif typ == "Union":
        if len(params) == 0:
            _err(1)
    elif typ == "List":
        if len(params) > 1:
            _err(1)
    elif typ == "Dict":
        if len(params) not in (0, 2):
            _err(2, True)
    return typ, params