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

import typing

import pydantic
from ...core.pydantic_utilities import IS_PYDANTIC_V2
from ...core.unchecked_base_model import UncheckedBaseModel


class StartAgentsRequestPropertiesLlmMcpServersItem(UncheckedBaseModel):
    name: str = pydantic.Field()
    """
    A unique identifier for the MCP server. Maximum 48 characters. Accepts only English letters and numbers.
    """

    endpoint: str = pydantic.Field()
    """
    The endpoint address of the MCP server. The agent uses this to communicate with the MCP server.
    """

    transport: typing.Optional[typing.Literal["streamable_http"]] = pydantic.Field(default=None)
    """
    Transport protocol type.
    - `streamable_http`: Streaming HTTP protocol
    """

    headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
    """
    HTTP header information to include when requesting the MCP server, such as authentication information.
    """

    allowed_tools: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    A list of tools that the agent is allowed to invoke. The agent can only use tools on this list.
    - Empty or omitted: All tools are enabled.
    - Empty array `[]`: No tools are enabled.
    - `["*"]`: All tools are enabled.
    - Specific tools `["aa", "bb"]`: Only listed tools are enabled.
    - Mix with wildcard `["aa", "*"]`: All tools are enabled (wildcard takes precedence).
    """

    timeout_ms: typing.Optional[int] = pydantic.Field(default=None)
    """
    The MCP server request timeout in milliseconds. After timeout, the agent stops waiting for the MCP server's response and continues executing subsequent logic.
    """

    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
