docs(examples): add Bilig WorkPaper MCP example#1297
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a new example demonstrating VoltAgent control of a Bilig WorkPaper via MCP: project scaffolding, MCP config (pinned ChangesBilig WorkPaper MCP Example
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
examples/with-bilig-workpaper-mcp/src/proof.ts (1)
101-113: 💤 Low valueRedundant validation after
findToolalready checks.The
findToolcall at line 106 already validates thattool.executeis a function (line 63). The check at lines 108-109 is redundant.♻️ Proposed simplification
async function callTool( tools: readonly ExecutableTool[], suffix: string, args: JsonRecord, ): Promise<JsonRecord> { const tool = findTool(tools, suffix); - const execute = tool.execute; - if (typeof execute !== "function") { - throw new Error(`Missing executable Bilig MCP tool: ${suffix}`); - } - - return structuredContent(await execute(args), suffix); + return structuredContent(await tool.execute(args), suffix); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/with-bilig-workpaper-mcp/src/proof.ts` around lines 101 - 113, The check for execute being a function in callTool is redundant because findTool already ensures tool.execute is callable; remove the typeof execute !== "function" guard and its error throw, and simply invoke tool.execute(args) (or await tool.execute(args)) and pass the result to structuredContent; reference functions/classes: callTool, findTool, ExecutableTool, execute, and structuredContent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@examples/with-bilig-workpaper-mcp/src/proof.ts`:
- Around line 101-113: The check for execute being a function in callTool is
redundant because findTool already ensures tool.execute is callable; remove the
typeof execute !== "function" guard and its error throw, and simply invoke
tool.execute(args) (or await tool.execute(args)) and pass the result to
structuredContent; reference functions/classes: callTool, findTool,
ExecutableTool, execute, and structuredContent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d069f606-18d1-4164-9153-22e3afa3d535
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
examples/README.mdexamples/with-bilig-workpaper-mcp/.env.exampleexamples/with-bilig-workpaper-mcp/.gitignoreexamples/with-bilig-workpaper-mcp/README.mdexamples/with-bilig-workpaper-mcp/package.jsonexamples/with-bilig-workpaper-mcp/src/index.tsexamples/with-bilig-workpaper-mcp/src/mcp.tsexamples/with-bilig-workpaper-mcp/src/proof.tsexamples/with-bilig-workpaper-mcp/tsconfig.json
ae36c59 to
21f1c2f
Compare
21f1c2f to
a4267af
Compare
Summary
examples/with-bilig-workpaper-mcp, a VoltAgent MCP example for formula-backed WorkPaper automation.@bilig/workpaper@0.90.8throughMCPConfigurationusing stdio and a pinnednpm exec --packagecommand.pnpm proofscript that calls the MCP tools directly, editsInputs!B3, verifies recalculatedSummary!B3, exports the WorkPaper document, and confirms restart readback.examples/README.md.Validation
pnpm --filter voltagent-example-with-bilig-workpaper-mcp install --lockfile-only --ignore-scriptspnpm --dir examples/with-bilig-workpaper-mcp buildpnpm --dir examples/with-bilig-workpaper-mcp proofpnpm exec biome check examples/with-bilig-workpaper-mcp/src/mcp.ts examples/with-bilig-workpaper-mcp/src/proof.ts examples/with-bilig-workpaper-mcp/src/index.ts examples/with-bilig-workpaper-mcp/tsconfig.json examples/with-bilig-workpaper-mcp/README.md examples/README.mdgit diff --checkThe proof run discovers all seven Bilig MCP tools, changes the demo win rate input, reads
Summary!B3as96000, and verifies persisted readback after reconnecting.Notes
The example intentionally does not add
@bilig/workpaperas a package dependency. The MCP command pins@bilig/workpaper@0.90.8withnpm exec, which matches the existing MCP example pattern and keeps the lockfile change limited to the new example importer.Summary by cubic
Adds
examples/with-bilig-workpaper-mcp, a VoltAgent example that connects to the Bilig WorkPaper MCP to edit inputs, recalc formulas, and verify persisted WorkPaper JSON. Includes a no-keypnpm proofthat exercises MCP tools and confirms restart readback.@bilig/workpaper@0.93.0viaMCPConfiguration(stdio) using pinnednpm exec --package.validate_formula), setsInputs!B3to0.4, verifiesSummary!B3is96000, validates a sample formula, exports the document, and prints discovered tools..env.example,.gitignore, a runnable agent (pnpm dev), and links the example inexamples/README.md.Written for commit a4267af. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
New Example
Documentation
Configuration
Scripts & Proof
Packaging & Tooling