@W-21748754: Add get-custom-view-image tool#313
@W-21748754: Add get-custom-view-image tool#313anyoung-tableau wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new MCP tool for retrieving images for Tableau custom views (saved view state), plus supporting REST API plumbing, docs, and tests. Also refactors view image format/version gating into a shared helper.
Changes:
- Introduces
get-custom-view-imagetool (custom view LUID → image), wiring it into tool registration, names, and OAuth scopes. - Extends Tableau REST SDK with
getCustomViewImage+ shared query-image error handling. - Adds docs and automated tests (unit + e2e + OAuth authz) for the new tool and updates
get-view-imagedocs.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/oauth/tableau-authz/tests/getCustomViewImage.test.ts | OAuth tool-path smoke test for the new tool |
| tests/e2e/views/getCustomViewImage.test.ts | E2E validation of PNG output for custom view images |
| src/tools/views/getViewImage.ts | Refactors format/version logic into shared helper; updates description |
| src/tools/views/getImageFormatForVersion.ts | New shared helper for SVG-version gating (needs import fixes) |
| src/tools/views/getCustomViewImage.ts | New tool implementation for custom view images |
| src/tools/views/getCustomViewImage.test.ts | Unit tests for the new tool (currently has mocking/assertion issues) |
| src/tools/tools.ts | Registers the new tool factory |
| src/tools/toolName.ts | Adds tool name + tool group entry |
| src/server/oauth/scopes.ts | Adds required OAuth scopes mapping for the new tool |
| src/sdks/tableau/methods/viewsMethods.ts | Adds REST method + shared error handler for image-query endpoints |
| src/sdks/tableau/apis/viewsApi.ts | Adds REST endpoint definition for custom view image (missing format param) |
| docs/docs/tools/views/get-view-image.md | Fixes heading level + clarifies example result behavior |
| docs/docs/tools/views/get-custom-view-image.md | New documentation page for the new tool |
| docs/docs/intro.md | Adds the new tool to the tools table + reference link |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| The height of the rendered image in pixels that, along with the value of `width`, determine its | ||
| resolution and aspect ratio. | ||
|
|
||
| Example: `1200` |
| ### `viewFilters` | ||
|
|
||
| Map of filter field names to values; sent as `vf_<fieldname>` query parameters per | ||
| [filter query views](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#Filter-query-views). |
There was a problem hiding this comment.
may be missing <hr />, not sure if that's what you want.
| /** | ||
| * Returns an image of the specified custom view (saved view state / filters). | ||
| * | ||
| * Required scopes: `tableau:views:download` |
There was a problem hiding this comment.
not sure if we want to start adding tableau:mcp_site_settings:read here and to the other tools.
|
|
||
| const paramsSchema = { | ||
| customViewId: z.string(), | ||
| width: z.number().gt(0).optional(), |
There was a problem hiding this comment.
you can add .int() here if you want, not necessary though.
This is the final PR in the trio to add support for custom views.