feat(dify): give the Dify plugin every tool of Rollstack's MCP server

Merged
YO
6d ago
+34852-1236

What

The Dify plugin had 12 tools, and none that adds data to a deck, while every other Rollstack listing gets all the tools of Rollstack's MCP server. It now has 121: every tool of the server except four that only the server's own viewers call.

  • Generated, not hand-written. integrations/dify/tests/generate_tools.py writes the 121 tool files and their classes from the server's definitions. It also writes rollstack_client/tools.json (how each Dify parameter maps onto the tool's arguments), the provider's tool list, and two tables in the plugin's README. test_contract.py fails when a generated file differs from what the generator writes, or when the plugin's tools aren't the server's minus the excluded four.
  • Refresh. tests/update_fixture.py saves the server's whole tool list, plus what each tool answers, read from Rollstack's public OpenAPI document. Then it runs the generator. It still saves nothing when a tool goes missing from the list, and names the scope the key lacks.
  • Runtime. Dify has no list or object parameters for a plugin's tools. A list of strings is text separated by commas or a JSON array, and any other structured input is JSON text whose JSON Schema its description gives. Booleans and numbers are converted. Every field of an answer is a workflow variable. Slide images come back as image files, with their base64 taken out of the JSON the model reads.
  • Docs. The README covers the scopes, what is different in Dify, and the calls that email people or delete something. PRIVACY.md covers the wider data. DEVELOPMENT.md covers the generator and the refresh, and AGENTS.md says the tool files are generated.
  • Descriptions. Both description fields, and the first line of the plugin's README, take the line chosen for every listing: "Build polished presentations using AI, with advanced charts and data connections built in."

Left out, and why

getTemplatePickerCovers, getReportMessageProgress, getReportViewerSlideImages and confirmAction. The server marks them as visible only to its own views, and the model never calls them in any client. confirmAction also needs a token that only the confirmation card holds. A test fails if the server marks another tool this way.

Tools that need a word

  • Viewers. showReport and showTemplates are in. Their own descriptions say what they answer when no viewer can be shown: the slides' ids and titles, and the templates.
  • Uploads. createDatasetUpload answers a link to send a file to from a shell, which a Dify agent doesn't have. An agent writes CSV into createDataset; a workflow can send a file to the link with an HTTP Request node.
  • Emails and deletes. The README lists 25 tools that email people or delete something.
    • Rollstack holds nine of them until the user confirms in Rollstack: the email sends, runs that would email, approving a proposal that sends one, deleting a burst and removing its variants. They are exactly the tools the server marks with its confirmation card, and a test checks that.
    • The others run at once: sharing (the member gets an email), test emails (to the user alone), and deleting a template, memory, uploaded file, datasheet, parameter or burst email configuration, unsharing, and removing slides.
    • Dify has no step to approve a tool call, so the README asks builders to give an agent only the tools it needs, and the key only the scopes it needs.

Dify's limits

  • No cap on tools. Nothing in Dify's plugin daemon limits the number of tools in a plugin. The package is 255 files and 244 KB, against a 50 MB ceiling.
  • Messages. Each message a plugin sends back is capped at 5 MB, and each slide image goes out as its own message.
  • Models. Some models accept at most 128 tools in one request. The README says to add only the tools an app needs.
  • Marketplace review. The Dify PR body (marketplace/pull-request.md) moves to High risk. Some tools run SQL through Rollstack (queryReportData, the datasheet changes), others send email, delete data and return members' personal data. Dify's rule is to pick the higher level when unsure. The security notes set out the boundary, as Dify's High-risk check asks.

Key scopes

The README now lists all seven scopes the tools use: slide_decks:read, slide_decks:write, slide_decks:run, slide_decks:email, connections:read, smtp:read, and users:read, which only owners and admins can grant and listMembers needs. Each tool's scope is in the generated table.

Tested

  • Dify plugin tests, Python 3.12: 725 passed. Live tests: 2 passed, and 2 skipped because they need a key.
  • dify plugin package (CLI 0.6.15): 255 files.
  • Dify's validate-difypkg.py with the PR body: exit 0, 12 checks pass. Dify's template and High-risk review checks report nothing.
  • The package in the CLI's local runtime (dify plugin run): the runtime read all 121 tool declarations. Calls to new tools (listConnections, createDataset, addReportDatasheets, queryReportData, getReportSlideImages) reached Rollstack and got the expected wrong-key errors, and bad inputs failed before any request.
  • build-index --check, check-versions, build-chatgpt-zip, build-perplexity-zip and claude plugin validate --strict . pass.

Not tested

  • Real use. The plugin hasn't run in a Dify workspace or with a real Rollstack key.
  • Fixture age. The fixture is the list the server gave on 17 November, before it required a key. On 18 November, 115 of the 118 tools in the public OpenAPI document still matched it. renderReportSlides, previewReportDatasheetChanges and saveReportDatasheetChanges had gained an optional optional field on column renames. Refreshing with a key picks that up; the command is in DEVELOPMENT.md.
  • Answer shapes. How getReportSlideImages answers over MCP is taken from the docs: the plugin handles both image blocks and base64 in JSON.
  • CI. No CI job runs the Dify tests.

Merging

This branch and #16 both set the two Dify description lines, in integrations/dify/manifest.yaml and integrations/dify/provider/rollstack.yaml; nothing else conflicts. #16 sets them without "and data connections built in", because main's Dify plugin has no data tools yet. Merge #16 first, then rebase this branch and keep its full line.

šŸ¤– Generated with Claude Code


Summary by cubic

The Dify plugin now exposes all 121 tools of Rollstack's MCP server a model can call, replacing its previous 12.

Generated tooling

  • Tool files come from tests/generate_tools.py based on server definitions; test_contract.py flags any drift.
  • tests/update_fixture.py refreshes the stored tool list and answer shapes, then regenerates; it needs a key with every scope, made by an owner or admin.
  • Dify lacks list and object parameters, so lists of strings are comma-separated text and structured inputs are JSON text; every answer field is a workflow variable and slide images come back as image files.

Security and docs

  • The README flags the 25 tools that email or delete and which ones Rollstack holds for confirmation; the Marketplace PR body moves to High risk since some tools run SQL, send email, delete data, and return personal data.
  • The 70 tools with an idempotency key now expose it as an optional parameter; the plugin still generates one when absent.
  • Null inputs are sent as null instead of the string "null", and unreadable images are reported rather than silently dropped.
  • PRIVACY.md now covers comments, memories, readership, and connected email servers.
  • All seven key scopes are documented, and both description fields and the README's opening use the standard listing line; main is merged so no further merge coordination is needed.