Skip to content

@W-21748754: Add get-custom-view-image tool#313

Open
anyoung-tableau wants to merge 5 commits intomainfrom
anyoung/get-custom-view-image
Open

@W-21748754: Add get-custom-view-image tool#313
anyoung-tableau wants to merge 5 commits intomainfrom
anyoung/get-custom-view-image

Conversation

@anyoung-tableau
Copy link
Copy Markdown
Collaborator

@anyoung-tableau anyoung-tableau commented Apr 16, 2026

This is the final PR in the trio to add support for custom views.

Copilot AI review requested due to automatic review settings April 16, 2026 23:20
@anyoung-tableau anyoung-tableau changed the title Add get-custom-view-image tool @W-21748754: Add get-custom-view-image tool Apr 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-image tool (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-image docs.

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.

Comment thread src/tools/views/getImageFormatForVersion.ts Outdated
Comment thread src/tools/views/getCustomViewImage.test.ts Outdated
Comment thread src/tools/views/getCustomViewImage.test.ts
Comment thread src/sdks/tableau/apis/viewsApi.ts
Comment thread src/tools/views/getViewImage.ts
The height of the rendered image in pixels that, along with the value of `width`, determine its
resolution and aspect ratio.

Example: `1200`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing <hr />

### `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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add .int() here if you want, not necessary though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants