""" Pydantic model for get_o11y_delta_path tool input validation. Validates cluster scope parameters for GS API lookup. """ from pydantic import BaseModel, Field, field_validator class GetO11yDeltaPathRequest(BaseModel): """Input model for resolving Observability Delta Lake table paths.""" cluster_id: str = Field( ..., description="TiDB Cloud cluster ID (applicationID)", ) env: str = Field( ..., description="Environment name used in biz_type resolution (e.g. prod, staging, dev)", ) deploy_type: str = Field( ..., description=( "Cluster deploy type used in biz_type resolution " "(dedicated, premium, resource_pool, starter, essential)" ), ) @field_validator("env", "deploy_type", mode="before") @classmethod def normalize_scope_text(cls, v: str) -> str: return v.strip().lower() @field_validator("cluster_id", mode="before") @classmethod def normalize_cluster_id(cls, v: object) -> str: if not isinstance(v, str): raise ValueError("cluster_id must be a string. Quote numeric IDs explicitly.") return str(v).strip()