@backblaze-labs/b2-mcp
    Preparing search index...

    Function resolveLocalPath

    • Validate a caller-supplied local file path against the server's filesystem policy and return a safe absolute path to use. Throws FileAccessError when access is disabled or the path escapes the sandbox root.

      • read: the file must exist; its real path (symlinks resolved) must be inside the root.
      • write: the file need not exist yet, but its resolved path and nearest existing ancestor must both be inside the root, so symlinked ancestors can't redirect the write outside.

      Parameters

      • config: B2Config

        Runtime filesystem policy from server configuration.

      • userPath: string

        Caller-supplied path to validate.

      • mode: "write" | "read"

        Whether the caller intends to read or write the path.

      Returns string

      The safe absolute path to use for the requested access.

      FileAccessError when local file access is disabled or outside policy.