@@ -90,6 +90,7 @@ AI agents can now:
9090Wrap your existing APIs with semantic understanding:
9191
9292``` python
93+ from typing import Literal
9394from enrichmcp import EnrichMCP, EnrichModel, Relationship
9495from pydantic import Field
9596
@@ -101,7 +102,9 @@ class Customer(EnrichModel):
101102
102103 id : int = Field(description = " Unique customer ID" )
103104 email: str = Field(description = " Primary contact email" )
104- tier: str = Field(description = " Subscription tier: free, pro, enterprise" )
105+ tier: Literal[" free" , " pro" , " enterprise" ] = Field(
106+ description = " Subscription tier"
107+ )
105108
106109 # Define navigable relationships
107110 orders: list[" Order" ] = Relationship(description = " Customer's purchase history" )
@@ -113,7 +116,9 @@ class Order(EnrichModel):
113116 id : int = Field(description = " Order ID" )
114117 customer_id: int = Field(description = " Associated customer" )
115118 total: float = Field(description = " Order total in USD" )
116- status: str = Field(description = " Order status: pending, shipped, delivered" )
119+ status: Literal[" pending" , " shipped" , " delivered" ] = Field(
120+ description = " Order status"
121+ )
117122
118123 customer: Customer = Relationship(description = " Customer who placed this order" )
119124
@@ -242,6 +247,7 @@ class Order(EnrichModel):
242247 email: EmailStr = Field(description = " Customer email" )
243248 status: Literal[" pending" , " shipped" , " delivered" ]
244249```
250+ ` describe_model() ` will list these allowed values so agents know the valid options.
245251
246252### ✏️ Mutability & CRUD
247253
0 commit comments