# 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 .tool_id import ToolId


class InlineMcpToolConfiguration(UniversalBaseModel):
    """
    An MCP tool configuration defined inline in the agent.
    """

    type: typing.Literal["mcp"] = "mcp"
    tool_id: ToolId
    argument_override: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Optional hardcoded arguments for tool calls. The key specifies the location in the tool arguments to overide, and the value specifies what to override with. The LLM will not be able to change the parameters, nor know those values exist within the tool.
    
    The values can also be dynamic references to context values using $ref with dot notation path syntax:
    - Static value: "fixed_value" or 123
    - Dynamic reference: `{"$ref": "session.metadata.field_name"}`
    
    References are resolved at runtime from context:
    - session.metadata.* - Access session metadata fields
    - agent.metadata.* - Access agent metadata fields
    
    Example:
      `{"query": {"$ref": ".session.metadata.query"}}`
    
    If you want to have a real value `"$ref"` use `"$$ref"`, that is you can escape the first $ by using $$.
    """

    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
