codeant-ai-for-open-source[bot] commented on code in PR #40961:
URL: https://github.com/apache/superset/pull/40961#discussion_r3482508376


##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -376,6 +376,17 @@ class GetDashboardLayoutRequest(BaseModel):
     ]
 
 
+class GetDashboardDatasetsRequest(BaseModel):
+    """Request schema for get_dashboard_datasets."""
+
+    identifier: Annotated[
+        int | str,
+        Field(
+            description="Dashboard identifier - can be numeric ID, UUID 
string, or slug"
+        ),
+    ]

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag dashboard MCP request identifiers for accepting int | str in 
this folder; these schemas intentionally allow numeric ID, UUID, or slug for 
consistency with sibling dashboard tools and documented behavior.
   
   **Applied to:**
     - `superset/mcp_service/dashboard/**`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -1512,3 +1523,225 @@ def dashboard_layout_serializer(dashboard: "Dashboard") 
-> DashboardLayout:
             has_layout=bool(position_json_str),
         )
     )
+
+
+# Per-dataset caps keep responses small enough for LLM context: wide
+# datasets can have hundreds of columns, which would dwarf the fields an
+# agent actually needs to configure native filters.
+MAX_DASHBOARD_DATASET_COLUMNS = 100
+MAX_DASHBOARD_DATASET_METRICS = 50
+
+
+class DashboardDatasetColumn(BaseModel):
+    """Lean column representation for dashboard dataset context."""
+
+    column_name: str = Field(..., description="Column name")
+    verbose_name: str | None = Field(None, description="Verbose (display) 
name")
+    type: str | None = Field(None, description="Column data type")
+    is_dttm: bool | None = Field(None, description="Is datetime column")
+
+
+class DashboardDatasetMetric(BaseModel):
+    """Lean metric representation for dashboard dataset context."""
+
+    metric_name: str = Field(..., description="Saved metric name")
+    verbose_name: str | None = Field(None, description="Verbose (display) 
name")
+    expression: str | None = Field(None, description="SQL expression")
+
+
+class DashboardDatasetDatabaseInfo(BaseModel):
+    """Database connection summary for a dashboard dataset."""
+
+    id: int | None = Field(None, description="Database ID")

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag integer ID fields in MCP dashboard schemas when they are kept 
for consistency with the existing MCP schema identifiers; allow the current 
`id`/`database_id` convention instead of requiring UUID-only variants.
   
   **Applied to:**
     - `superset/mcp_service/dashboard/**`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to