Skip to content

[PIGS-839] Add extract_fillable_form_data MCP tool#98

Merged
rpalekar merged 1 commit into
mainfrom
PIGS-839-extract-fillable-form-data
Jul 7, 2026
Merged

[PIGS-839] Add extract_fillable_form_data MCP tool#98
rpalekar merged 1 commit into
mainfrom
PIGS-839-extract-fillable-form-data

Conversation

@RogerThomas

@RogerThomas RogerThomas commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Ticket

PIGS-839 — PDF acro form extract data

What

Adds the extract_fillable_form_data MCP tool: extracts the existing AcroForm field data (names, values, types, positions) from a PDF via the new extract-fillable-form-data extractions method. JSON only per the ticket's MCP acceptance criteria (flat formFields list, outputTarget inline/file/both via the standard jsonResult helper); the name/value pairs round-trip directly into fill_forms — the ticket's primary motivation is MCP-driven form filling.

  • extractFillableFormData handler in src/handlers/platformHandler.ts (method: 'extract-fillable-form-data', params: {} so the API's JSON default applies)
  • Tool registration in src/tools/extractions.ts (READ_ONLY, stemSuffix: 'form-data')
  • Tool-level + handler-level Vitest coverage following the sibling tools' patterns

Checks

task n:check (prettier, tsc, eslint) clean; task n:test — 186 tests passed.

Sibling PRs

🤖 Generated with Claude Code

Extracts existing AcroForm field data (names, values, types, positions)
from a PDF via the new extract-fillable-form-data extractions method.
JSON only, flat formFields list; pairs round-trip into fill_forms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 extraction capability to the Node MCP server for reading existing AcroForm field data from fillable PDFs, enabling MCP-driven “inspect then fill” workflows that round-trip into fill_forms.

Changes:

  • Introduces extract_fillable_form_data MCP tool with outputTarget support via jsonResult (inline/file/both).
  • Adds PlatformHandler.extractFillableFormData() to call the platform extraction method extract-fillable-form-data with JSON accept format.
  • Extends Vitest coverage across handler + tool layers and updates shared handler mocks used by other tool tests.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
node-version/src/tools/extractions.ts Registers the new extract_fillable_form_data tool and routes its JSON output through jsonResult.
node-version/src/handlers/platformHandler.ts Adds extractFillableFormData() extraction call and reuses _extractResult to normalize JSON responses.
node-version/tests/extractions.test.ts Adds tool-level tests for default inline output, file output, and error propagation.
node-version/tests/platformHandler.test.ts Adds handler-level test asserting the correct platform method/params and returned extracted JSON buffer.
node-version/tests/helpers/fixtures.ts Extends MockPlatformHandler and factory to include extractFillableFormData.
node-version/tests/conversions.test.ts Updates platform handler mock shape to include the new method.
node-version/tests/generations.test.ts Updates platform handler mock shape to include the new method.
node-version/tests/pii.test.ts Updates platform handler mock shape to include the new method.
node-version/tests/rendering.test.ts Updates platform handler mock shape to include the new method.
node-version/tests/transformations.test.ts Updates platform handler mock shape to include the new method.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@rpalekar rpalekar merged commit 7381b99 into main Jul 7, 2026
8 checks passed
@rpalekar rpalekar deleted the PIGS-839-extract-fillable-form-data branch July 7, 2026 13:03
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.

4 participants