Skip to content

FIO–11561: Add Form revision MCP tools#3

Open
blakekrammes wants to merge 2 commits intomainfrom
form-revisions
Open

FIO–11561: Add Form revision MCP tools#3
blakekrammes wants to merge 2 commits intomainfrom
form-revisions

Conversation

@blakekrammes
Copy link
Copy Markdown
Contributor

@blakekrammes blakekrammes commented May 5, 2026

Summary

Adds MCP server tools for Form.io form revisions and draft/publish workflow. Closes FIO-11561.

New MCP Tools

Tool Endpoint Purpose
form_revisions_list GET /form/:id/v List published revisions as compact summaries (vid, modified, user, note); strips full form snapshot — use form_revision_get for the body
form_revision_get GET /form/:id/v/:version Fetch a single immutable revision by _vid or revision _id
form_revisions_set PUT /form/:id Set the form's revisions field. Required mode: "current" | "original" | "" — enable, switch display mode, or disable. No default — schema rejects calls without mode so the agent asks the user
form_draft_create PUT /form/:id/draft (+ post-PUT GET /draft) Save or overwrite the single active draft. Optional note rides as _vnote
form_draft_get GET /form/:id/draft Fetch the mutable active draft (_vid: "draft" row). Distinct from form_revision_get, which fetches an immutable numbered revision
form_draft_publish PUT /form/:id Promote the saved draft (or a caller-supplied definition) to the next published revision

Skill reference at plugin/skills/formio-api/references/project-form-revisions.md documents endpoint shapes and edge cases.

Draft _vnote Not Preserved on Publish

form_draft_publish strips _vnote from the publish body (merged draft or caller definition). Published revision's _vnote comes only from the explicit note arg.

Matches portal: draft note (WIP) and publish note (revision note) are independent. Tool + note param descriptions tell the agent to leave note undefined unless the user explicitly states the publish note.

Schema Merge (Draft → Publish)

form_draft_publish overlays only components, settings, tags, properties, display from the draft onto the current published form. Form-level fields (access, submissionAccess, revisions, owner, _id, project) always preserved from current.

Mirrors portal checkDraft() (form.js:1577-1586). Implementation: packages/mcp-server/src/tools/form-draft-merge.ts.

@blakekrammes blakekrammes changed the title Form revisions FIO–11561: Add Form revision MCP tools May 5, 2026
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.

1 participant