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

   ### SUMMARY
   
   LLMs consistently call `list_datasets` (and related list tools) with flat
   top-level kwargs like `search`, `page`, `page_size` instead of wrapping them
   in the required `request` object, resulting in pydantic validation errors:
   
   ```
   pydantic_core.ValidationError: 4 validation errors for call[list_datasets]
     request: Missing required argument
     search: Unexpected keyword argument
     page: Unexpected keyword argument
     page_size: Unexpected keyword argument
   ```
   
   This PR makes the calling convention explicit in the tool docstrings and
   improves filter column descriptions to enumerate valid values.
   
   **Changes:**
   
   - Add docstring usage examples to `list_datasets`, `list_charts`, and
     `list_dashboards` showing the correct `request={...}` call shape, with
     an explicit warning that flat kwargs are rejected
   - Enumerate valid `col` values directly in `DatasetFilter`, `ChartFilter`,
     and `DashboardFilter` field descriptions (e.g. `created_by_fk` is not a
     valid dataset filter column)
   - Add `TestListDatasetsRequestWrapper` unit tests covering: correct wrapper
     usage, defaults, valid/invalid `col` validation, and the flat-kwargs
     rejection scenario
   - Allow `E501` in `list_*.py` tool files in ruff config (docstring examples
     with full request shapes exceed the 88-char limit)
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — docstring and schema description changes only.
   
   ### TESTING INSTRUCTIONS
   
   1. Run the new unit tests:
      ```bash
      pytest 
tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py::TestListDatasetsRequestWrapper
 -v
      ```
   2. Inspect the updated docstrings in `list_datasets`, `list_charts`,
      `list_dashboards` — the `IMPORTANT` block and example usage should be
      clearly visible.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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