CoAgent8 - Source API
    Preparing search index...

    Function chooseWorkspace

    • Chooses the workspace of one call.

      Parameters

      • rawPath: string | null | undefined

        The caller's workspace_path, which always wins.

      • roots: readonly string[] | null

        Directories from the client's MCP roots, or null when the client does not provide roots.

      • serverDirectory: string = ...

        The server's working directory, used only when it is a plausible project.

      Returns ResolvedWorkspace

      ToolError with INPUT_LIMIT when roots are ambiguous or no plausible workspace remains.

      Several roots, as Claude Code reports after --add-dir, resolve to the one that contains the server's working directory (its launch directory).