Skip to content

feat: Add Excel to PDF tools (analyze and execute)#34

Merged
mido-app merged 3 commits into
developfrom
devin/1765361117-excel-to-pdf
Dec 15, 2025
Merged

feat: Add Excel to PDF tools (analyze and execute)#34
mido-app merged 3 commits into
developfrom
devin/1765361117-excel-to-pdf

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Dec 10, 2025

feat: Add Excel to PDF tools (analyze and execute)

Summary

This PR adds SDK support for the two new Excel to PDF tools introduced in middleman PR #627:

  • xlsx-to-pdf-analyze: Analyzes an Excel template and returns placeholder information (key, description, cell location, sheet name, number format)
  • xlsx-to-pdf-execute: Replaces placeholders in an Excel template and converts it to PDF

Changes include:

  • New Pydantic models: ExcelPlaceholder, ExcelToPdfAnalyzeResponse, ExcelToPdfExecuteResponse
  • New ToolsClient methods: excel_to_pdf_analyze(), excel_to_pdf_execute()
  • New MCP tools for AI agent integration
  • New CLI commands: excel-to-pdf-analyze, excel-to-pdf-execute
  • Comprehensive test coverage (see below)

Updates since last revision

  • Fixed endpoint URLs: Changed from excel-to-pdf-* to xlsx-to-pdf-* to match the actual middleman API
  • Fixed request parameter name: Changed from excel_template_id to xlsx_template_id to match the API specification
  • Added CLI tests: 5 tests covering basic usage, sheet name option, warnings, and invalid JSON handling
  • Added MCP tests: 4 tests covering basic usage, sheet name parameter, and warnings
  • Added VCR tests: 2 integration tests with cassettes recorded from production API
  • Updated vcr_utils.py: Added xlsx_template_id scrubbing for VCR cassettes

Review & Testing Checklist for Human

  • Verify response models match actual API: The ExcelPlaceholder.description field is required in the SDK but has default="" in the API - verify this doesn't cause validation errors when the API omits the field
  • Test CLI stdin handling: The excel-to-pdf-execute CLI reads placeholders JSON from stdin. Verify this works correctly: echo '{"name": "test"}' | middleman excel-to-pdf-execute <xlsx_template_id>
  • Review VCR cassettes: Confirm no sensitive data leaked in the new cassette files (test_excel_to_pdf_analyze_vcr.yaml, test_excel_to_pdf_execute_vcr.yaml)

Recommended Test Plan

  1. Upload an Excel template with placeholders to middleman
  2. Run middleman excel-to-pdf-analyze <xlsx_template_id> and verify placeholder info is returned
  3. Run echo '{"placeholder_key": "value"}' | middleman excel-to-pdf-execute <xlsx_template_id> and verify PDF is generated
  4. Test MCP tools via Claude Desktop or MCP inspector

Notes

mido-app and others added 2 commits July 7, 2025 14:25
- Add ExcelPlaceholder, ExcelToPdfAnalyzeResponse, ExcelToPdfExecuteResponse models
- Add excel_to_pdf_analyze and excel_to_pdf_execute methods to ToolsClient
- Add Excel to PDF MCP tools to server.py
- Add Excel to PDF CLI commands to main.py
- Add comprehensive unit tests for Excel to PDF tools

Co-Authored-By: yutaka.omido@generative-agents.co.jp <yutaka.omido@generative-agents.co.jp>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Original prompt from yutaka.omido@generative-agents.co.jp
https://github.com/GenerativeAgents/middleman/pull/627/files

新しいツールExcel to PDF系2つを追加するプルリクです、まずはキャッチアップしてください

そして、このツールに対応する呼び出しを以下のクライアントSDKに追加したいので対応お願いします
また、対応できていないツールが他にないか漏れをチェックしてください
https://github.com/GenerativeAgents/middleman-sdk

いきなり作らず、まずは計画をした上で計画を合意してから進めたいので、
調査結果と、それを元にしてプランを立てて提示してくれるとありがたい

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 10, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

- Change endpoint URLs from excel-to-pdf-* to xlsx-to-pdf-*
- Change parameter name from excel_template_id to xlsx_template_id
- Update client.py, cli/main.py, mcp/server.py, and tests

Co-Authored-By: yutaka.omido@generative-agents.co.jp <yutaka.omido@generative-agents.co.jp>
@mido-app mido-app merged commit 149940f into develop Dec 15, 2025
4 checks passed
@mido-app mido-app deleted the devin/1765361117-excel-to-pdf branch December 15, 2025 04:27
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