Skip to content

datarobot_genai.drmcpbase.dynamic_tools.deployment.adapters.base

base

MetadataBase

Bases: ABC

Source code in datarobot_genai/drmcpbase/dynamic_tools/deployment/adapters/base.py
class MetadataBase(ABC):
    @property
    @abstractmethod
    def name(self) -> str:
        """The name of the tool, for the LLM to identify and call the tool."""
        pass

    @property
    @abstractmethod
    def description(self) -> str:
        """The description of the tool, for the LLM to understand its purpose
        and all additional instructions and context about the tool, which can
        help the LLM to better utilize the tool in the right context.
        """
        pass

    @property
    @abstractmethod
    def method(self) -> Literal["GET", "POST", "PATCH", "PUT", "DELETE"]:
        """HTTP method to use when calling the tool, e.g. `POST` or `GET` etc."""
        pass

    @property
    @abstractmethod
    def endpoint(self) -> str:
        """The endpoint path of the tool, e.g. `/weather/{city}/forecast`."""
        pass

    @property
    @abstractmethod
    def input_schema(self) -> dict[str, Any]:
        """The JSON schema defining the input parameters for the tool.

        Structure:
            {
                "type": "object",
                "properties": {
                    "path_params": {...},    # Optional: path parameter schemas
                    "query_params": {...},   # Optional: query parameter schemas
                    "data": {...},           # Optional: form/body data schema
                    "json": {...}            # Optional: JSON body schema
                },
                "required": [...]            # Optional: required properties
            }
        """
        pass

    @property
    @abstractmethod
    def headers(self) -> dict[str, str]:
        """Optional HTTP headers to include when calling the tool."""
        pass

name abstractmethod property

name: str

The name of the tool, for the LLM to identify and call the tool.

description abstractmethod property

description: str

The description of the tool, for the LLM to understand its purpose and all additional instructions and context about the tool, which can help the LLM to better utilize the tool in the right context.

method abstractmethod property

method: Literal['GET', 'POST', 'PATCH', 'PUT', 'DELETE']

HTTP method to use when calling the tool, e.g. POST or GET etc.

endpoint abstractmethod property

endpoint: str

The endpoint path of the tool, e.g. /weather/{city}/forecast.

input_schema abstractmethod property

input_schema: dict[str, Any]

The JSON schema defining the input parameters for the tool.

Structure

{ "type": "object", "properties": { "path_params": {...}, # Optional: path parameter schemas "query_params": {...}, # Optional: query parameter schemas "data": {...}, # Optional: form/body data schema "json": {...} # Optional: JSON body schema }, "required": [...] # Optional: required properties }

headers abstractmethod property

headers: dict[str, str]

Optional HTTP headers to include when calling the tool.