# 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 .mcp_tool_schema_allowed_tools import McpToolSchemaAllowedTools
from .mcp_tool_schema_require_approval import McpToolSchemaRequireApproval


class McpToolSchema(UniversalBaseModel):
    """
    MCP tool configuration schema.
    """

    server_label: str = pydantic.Field()
    """
    Server label
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    Tool type
    """

    allowed_tools: typing.Optional[McpToolSchemaAllowedTools] = pydantic.Field(default=None)
    """
    Allowed tools
    """

    authorization: typing.Optional[str] = pydantic.Field(default=None)
    """
    OAuth token
    """

    connector_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Connector ID
    """

    headers: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Custom headers
    """

    require_approval: typing.Optional[McpToolSchemaRequireApproval] = pydantic.Field(default=None)
    """
    Approval policy
    """

    server_description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Server description
    """

    server_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Server URL
    """

    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
