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

   ### SUMMARY
   
   Add `ToolAnnotations` (`title`, `readOnlyHint`, `destructiveHint`) to all 20 
MCP tools so that MCP directory services and clients can surface human-readable 
titles and understand each tool's safety profile.
   
   **What changed:**
   
   1. **Abstract decorator** 
(`superset-core/src/superset_core/mcp/decorators.py`): Added `annotations: 
ToolAnnotations | None = None` parameter and re-exported `ToolAnnotations` from 
`mcp.types` in `__all__`.
   
   2. **Concrete decorator** (`superset/core/mcp/core_mcp_injection.py`): Added 
`annotations` parameter that gets passed through to `Tool.from_function()`.
   
   3. **All 20 tool files**: Added `ToolAnnotations` import and 
`annotations=ToolAnnotations(title=..., readOnlyHint=..., 
destructiveHint=False)` to each `@tool(...)` decorator:
      - **14 read-only tools** (`readOnlyHint=True`): health_check, 
get_instance_info, get_schema, list_charts, get_chart_info, get_chart_preview, 
get_chart_data, list_dashboards, get_dashboard_info, list_datasets, 
get_dataset_info, execute_sql, open_sql_lab_with_context, generate_explore_link
      - **6 mutating tools** (`readOnlyHint=False`): generate_chart, 
update_chart, update_chart_preview, generate_dashboard, 
add_chart_to_existing_dashboard, save_sql_query
   
   **Why:**
   
   The MCP spec defines `ToolAnnotations` to help clients and directory 
services understand tool behavior. Adding `title` provides human-readable 
display names, `readOnlyHint` tells clients which tools only read data, and 
`destructiveHint=False` signals that no tool performs irreversible destructive 
operations.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable (backend-only change, no UI impact).
   
   ### TESTING INSTRUCTIONS
   
   1. Verify all 20 tool files have `ToolAnnotations` in their `@tool()` 
decorator
   2. Verify read-only tools have `readOnlyHint=True` and mutating tools have 
`readOnlyHint=False`
   3. Verify all tools have `destructiveHint=False`
   4. Run `ruff check` and `ruff format --check` on all changed files to 
confirm linting passes
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [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