async def METHOD_NAME(
    files_and_dirs: Sequence[Path],
    json_output: Optional[AsyncPath],
) -> None:
    input_files = _get_input_files(files_and_dirs)
    try:
        protocol_source = await ProtocolReader().read_saved(
            files=input_files,
            directory=None,
        )
    except ProtocolFilesInvalidError as error:
        raise click.ClickException(str(error))
    runner = await create_simulating_runner(
        robot_type=protocol_source.robot_type, protocol_config=protocol_source.config
    )
    analysis = await runner.run(protocol_source)
    if json_output:
        results = AnalyzeResults.construct(
            createdAt=datetime.now(tz=timezone.utc),
            files=[
                ProtocolFile.construct(name=f.path.name, role=f.role)
                for f in protocol_source.files
            ],
            config=(
                JsonConfig.construct(
                    schemaVersion=protocol_source.config.schema_version
                )
                if isinstance(protocol_source.config, JsonProtocolConfig)
                else PythonConfig.construct(
                    apiVersion=protocol_source.config.api_version
                )
            ),
            metadata=protocol_source.metadata,
            robotType=protocol_source.robot_type,
            commands=analysis.commands,
            errors=analysis.state_summary.errors,
            labware=analysis.state_summary.labware,
            pipettes=analysis.state_summary.pipettes,
            modules=analysis.state_summary.modules,
            liquids=analysis.state_summary.liquids,
        )
        await json_output.write_text(
            results.json(exclude_none=True),
            encoding="utf-8",
        )
    else:
        raise click.UsageError(
            "Currently, this tool only supports JSON mode. Use `--json-output`."
        )