aminghadersohi opened a new pull request, #40303:
URL: https://github.com/apache/superset/pull/40303
### SUMMARY
Adds 4 new MCP tools in a new `superset/mcp_service/annotation_layer/`
domain:
- `list_annotation_layers` — list annotation layers with filtering, search,
and 1-based pagination
- `get_annotation_layer_info` — get annotation layer details by ID
- `list_layer_annotations` — list annotations within a layer (requires
`layer_id` to scope results)
- `get_layer_annotation_info` — get a single annotation by `layer_id` +
`annotation_id`, with layer-membership verification
The annotation tools mirror the pattern used by `database/`, `dashboard/`,
and `dataset/` domains: Pydantic request/response schemas, `ModelListCore` for
listings, DAO-based lookups, `ToolAnnotations`, and `event_logger`
instrumentation.
For annotations, `layer_id` is a required parameter that scopes all results
to the parent layer — mirroring the Superset REST API structure (`GET
/annotation_layer/{layer_pk}/annotation/`).
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A (backend-only MCP tool additions)
### TESTING INSTRUCTIONS
1. Run unit tests:
```
pytest tests/unit_tests/mcp_service/annotation_layer/
```
2. Connect an MCP client and call:
- `list_annotation_layers({})` — lists all annotation layers
- `get_annotation_layer_info({"id": <id>})` — retrieves a specific layer
- `list_layer_annotations({"layer_id": <id>})` — lists annotations in a
layer
- `get_layer_annotation_info({"layer_id": <id>, "annotation_id": <id>})`
— retrieves a specific annotation
### 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]