# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .server_tools_result import ServerToolsResult
from .tool_format import ToolFormat


class MultiServerToolsResponse(UniversalBaseModel):
    success: bool = pydantic.Field()
    """
    Whether tools were retrieved successfully for all requested servers.
    """

    format: ToolFormat = pydantic.Field()
    """
    The format of the returned tools for all servers.
    """

    results: typing.Optional[typing.List[ServerToolsResult]] = pydantic.Field(default=None)
    """
    Per-server results including any partial failures.
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    Aggregated error message when one or more servers fail.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
