aminghadersohi opened a new pull request, #40352:
URL: https://github.com/apache/superset/pull/40352

   ### SUMMARY
   
   Adds `create_annotation_layer` as a new MCP mutation tool that allows AI 
assistants to create named annotation layers in Superset programmatically.
   
   The tool follows the existing mutation pattern (`create_virtual_dataset`) 
and calls the existing `CreateAnnotationLayerCommand`. It accepts a `name` 
(required) and optional `descr`, validates uniqueness, and returns the created 
layer's `id`, `name`, and `descr`.
   
   **New files:**
   - `superset/mcp_service/annotation_layer/__init__.py`
   - `superset/mcp_service/annotation_layer/schemas.py` — 
`CreateAnnotationLayerRequest` / `CreateAnnotationLayerResponse` Pydantic 
schemas
   - `superset/mcp_service/annotation_layer/tool/__init__.py`
   - `superset/mcp_service/annotation_layer/tool/create_annotation_layer.py` — 
the `@tool` implementation
   
   **Modified:**
   - `superset/mcp_service/app.py` — registers the new tool
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — backend-only change.
   
   ### TESTING INSTRUCTIONS
   
   1. Start a Superset instance with MCP enabled
   2. Connect an MCP client and call `create_annotation_layer` with 
`{"request": {"name": "My Layer"}}`
   3. Verify a new annotation layer appears in Superset → Manage → Annotation 
Layers
   4. Call again with the same name — verify a validation error is returned 
(name uniqueness)
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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