Skip to content

feat(mcp): add pay slip tools to demo server and LangGraph allowlist - #79

Open
srivilliamsai wants to merge 2 commits into
Workday:mainfrom
srivilliamsai:feat/mcp-payslip-tools
Open

srivilliamsai wants to merge 2 commits into
Workday:mainfrom
srivilliamsai:feat/mcp-payslip-tools

Conversation

@srivilliamsai

@srivilliamsai srivilliamsai commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Adds Workday pay slip lookup tools (get_current_user_payslips and get_payslip_by_worker_id) to the demo MCP server backed by the existing mock_data/pay_slips.json dataset, and registers them in the LangGraph reference allowlist.

Component(s) Changed

  • Bridge service
  • LangGraph orchestrator
  • Deprecated Flowise flow
  • Demo MCP Server
  • Documentation
  • CI/CD
  • Other

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  1. Ran python3 mcp-demo-server/check_payslips.py — verified current user history, period filtering, error handling for nonexistent periods/workers, and multi-currency (CNY, JPY, KRW) payloads.
  2. Ran ruff check . — all checks passed.
  3. Verified DEFAULT_MCP_TOOL_ALLOWLIST in bridge-service/app/orchestration/langgraph/tools/mcp.py contains all tools.
  4. Ran all existing bridge-service checks (check_async_runner.py, check_idempotency.py, check_lineworks_signature.py, check_llm_config.py, check_prompt_security.py) — all passed.

Checklist

  • I have verified my changes build and tested end-to-end where applicable
  • I have updated documentation as needed
  • My code follows the existing style
  • I have not committed any secrets or credentials
  • By submitting this pull request, I confirm that you may use my contribution under the terms of the LICENSE.md file.

Summary by cubic

Adds two pay slip lookup tools to the demo MCP server and registers them in the LangGraph tool allowlist, so agents can now retrieve pay slips by period or worker ID.

  • get_current_user_payslips and get_payslip_by_worker_id read from the existing mock_data/pay_slips.json and return an error dict for unknown periods or workers.
  • Both tools accept an optional YYYY-MM period filter; without it they return all available payslips for the user or worker.
  • Adds bridge-service/tests/check_payslips.py to verify behavior including multi-currency payloads (CNY, JPY, KRW).
  • Updates the Flowise reference flow and both README tool lists.

Written for commit b817bd5. Summary will update on new commits.

Review in cubic

RetriggerConfidence Score: 5/5

The PR appears safe to merge. One non-blocking test gap remains.

Findings

  1. P2 Current-user period checks vanished
  2. P2 check payslips.py is outside the tests/check .py path that CI runs, so these checks never run on pull requests. Move this check under the CI test path or add a workflow step for it.

Summary

  • Adds current-user and worker pay slip lookups backed by the existing mock dataset.
  • Supports full history, period filtering, missing-data errors, and multiple currencies.
  • Registers and documents both tools for LangGraph and Flowise.

Diagram

sequenceDiagram
    participant U as User
    participant A as LangGraph or Flowise
    participant M as MCP demo server
    participant D as pay_slips.json
    U->>A: Ask for pay slips
    A->>M: Call an allowed pay slip tool
    M->>D: Match current or requested worker and period
    D-->>M: Return matching fixture records
    M-->>A: Return a pay slip, history, or error
    A-->>U: Explain the result
Loading

Reviews (2) · Last reviewed commit: "docs: update flowise tool list and wire ..."

Copilot AI lite review requested due to automatic review settings September 14, 2026 09:47
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8ee0dcce-b7c7-45c6-a1a6-07f7db56e858

📥 Commits

Reviewing files that changed from the base of the PR and between 6b000d8 and b817bd5.

📒 Files selected for processing (2)
  • bridge-service/tests/check_payslips.py
  • flowise/README.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8524c6a8-0b45-43c5-8a31-b2f3dcecd576

📥 Commits

Reviewing files that changed from the base of the PR and between 33c8fc8 and 6b000d8.

📒 Files selected for processing (5)
  • bridge-service/app/orchestration/langgraph/tools/mcp.py
  • flowise/flows/workday-mcp-agent.json
  • mcp-demo-server/README.md
  • mcp-demo-server/check_payslips.py
  • mcp-demo-server/main.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added tools to retrieve payslips for the current user or a specified worker.
    • Supports filtering payslips by pay period, including all-period searches.
    • Added clear responses for missing payslips, invalid periods, and unknown workers.
    • Enabled these payslip tools by default in supported agent workflows.
  • Documentation

    • Updated the demo server documentation to describe the new payslip tools.
  • Tests

    • Added validation covering successful lookups, period filtering, currencies, amounts, and error cases.

Walkthrough

The change adds two payslip MCP tools, enables them in bridge and Flowise configurations, documents them, and adds a standalone verification script.

Changes

Payslip MCP tools

Layer / File(s) Summary
Implement payslip retrieval tools
mcp-demo-server/main.py
Adds current-user and worker-specific payslip tools with optional period filtering and error responses.
Expose and document MCP actions
bridge-service/.../mcp.py, flowise/flows/workday-mcp-agent.json, mcp-demo-server/README.md
Adds both tool names to the default allowlist and Flowise actions, and documents them.
Verify payslip responses
mcp-demo-server/check_payslips.py
Adds assertions for successful lookups, period filtering, currencies, pay amounts, and missing-data errors.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: samxli

Merge Risk: ⚪ Minimal · up to 6b000

The new mock payslip tools match the documented demo security model and are ready for normal merge checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the new pay slip tools and their registration in the LangGraph allowlist. This matches the main changes.
Description check ✅ Passed The description accurately covers the new pay slip tools, affected components, documentation updates, and testing. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

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.

🟡 Changes recommended

The verification script does not support configured worker IDs, and Flowise documentation is outdated.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Workday payslip lookup tools to the demo MCP server and exposes them through Flowise and LangGraph.

Changes:

  • Added current-user and worker-specific payslip tools.
  • Added verification checks and documentation.
  • Updated Flowise actions and the LangGraph allowlist.
File summaries
File Summary
mcp-demo-server/README.md Documents the new payslip tools.
mcp-demo-server/main.py Implements payslip lookups and filtering.
mcp-demo-server/check_payslips.py Adds payslip verification checks. Moderate (1 vote): assumes the current worker is always WK001.
flowise/flows/workday-mcp-agent.json Registers the new Flowise tools. Nit (3 votes): Flowise documentation still lists 11 tools and omits the new names.
bridge-service/app/orchestration/langgraph/tools/mcp.py Updates the LangGraph default tool allowlist.
Review details

Suppressed comments (1)

mcp-demo-server/check_payslips.py:50

  • This check assumes the current user is always WK001 (and has exactly two CNY slips), but main.py reads CURRENT_USER_WORKER_ID from the environment and the demo configuration explicitly allows changing it. With a supported value such as WK002 or WK003, python3 check_payslips.py fails even though the tool is behaving correctly; set the fixture user explicitly or derive the expected payload from the selected worker.
    assert len(all_slips["payslips"]) == 2, f"Expected 2 slips for WK001, got {len(all_slips['payslips'])}"
    assert all_slips["payslips"][0]["currency"] == "CNY"
    assert all_slips["payslips"][0]["gross_pay"] == 35000
    assert all_slips["payslips"][0]["net_pay"] == 25200
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"agentSelectedToolConfig": {
"mcpServerConfig": "{\n \"key\": \"wd-mcp-server\",\n \"url\": \"https://YOUR_MCP_SERVER_URL/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer YOUR_MCP_API_KEY\"\n },\n \"approvalPolicy\": \"always\"\n}",
"mcpActions": "[\"find_employee_id_by_name\",\"get_current_user_info\",\"get_current_user_time_off_balance\",\"get_current_user_time_off_history\",\"get_direct_reports\",\"get_more_employee_data\",\"get_my_time_off_eligibility\",\"get_personal_information\",\"get_today_date_and_day_of_week\",\"request_my_time_off\",\"get_time_off_balance\"]",
"mcpActions": "[\"find_employee_id_by_name\",\"get_current_user_info\",\"get_current_user_payslips\",\"get_current_user_time_off_balance\",\"get_current_user_time_off_history\",\"get_direct_reports\",\"get_more_employee_data\",\"get_my_time_off_eligibility\",\"get_payslip_by_worker_id\",\"get_personal_information\",\"get_today_date_and_day_of_week\",\"request_my_time_off\",\"get_time_off_balance\"]",
from main import CURRENT_USER_WORKER_ID, get_current_user_payslips, get_payslip_by_worker_id # noqa: E402


def main() -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 check_payslips.py is outside the tests/check_*.py path that CI runs, so these checks never run on pull requests. Move this check under the CI test path or add a workflow step for it.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 5 files

Confidence score: 5/5

  • flowise/README.md is out of sync with flowise/flows/workday-mcp-agent.json and the LangGraph allowlist: it still documents 11 Workday MCP tools and omits the two payslip tools, which could mislead users about available functionality. Update the README tool count and list to match the new flow and allowlist.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="flowise/flows/workday-mcp-agent.json">

<violation number="1" location="flowise/flows/workday-mcp-agent.json:732">
P3: flowise/README.md still lists the Workday MCP client as having 11 tools and omits the two new payslip tools, while this change adds them to both the Flowise flow and the LangGraph allowlist. The README's own sync requirement instructs keeping the tool list current. Update flowise/README.md's tool table and the "11 Workday tools" count to include `get_current_user_payslips` and `get_payslip_by_worker_id`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread bridge-service/tests/check_payslips.py
"agentSelectedToolConfig": {
"mcpServerConfig": "{\n \"key\": \"wd-mcp-server\",\n \"url\": \"https://YOUR_MCP_SERVER_URL/mcp\",\n \"headers\": {\n \"Authorization\": \"Bearer YOUR_MCP_API_KEY\"\n },\n \"approvalPolicy\": \"always\"\n}",
"mcpActions": "[\"find_employee_id_by_name\",\"get_current_user_info\",\"get_current_user_time_off_balance\",\"get_current_user_time_off_history\",\"get_direct_reports\",\"get_more_employee_data\",\"get_my_time_off_eligibility\",\"get_personal_information\",\"get_today_date_and_day_of_week\",\"request_my_time_off\",\"get_time_off_balance\"]",
"mcpActions": "[\"find_employee_id_by_name\",\"get_current_user_info\",\"get_current_user_payslips\",\"get_current_user_time_off_balance\",\"get_current_user_time_off_history\",\"get_direct_reports\",\"get_more_employee_data\",\"get_my_time_off_eligibility\",\"get_payslip_by_worker_id\",\"get_personal_information\",\"get_today_date_and_day_of_week\",\"request_my_time_off\",\"get_time_off_balance\"]",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: flowise/README.md still lists the Workday MCP client as having 11 tools and omits the two new payslip tools, while this change adds them to both the Flowise flow and the LangGraph allowlist. The README's own sync requirement instructs keeping the tool list current. Update flowise/README.md's tool table and the "11 Workday tools" count to include get_current_user_payslips and get_payslip_by_worker_id.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At flowise/flows/workday-mcp-agent.json, line 732:

<comment>flowise/README.md still lists the Workday MCP client as having 11 tools and omits the two new payslip tools, while this change adds them to both the Flowise flow and the LangGraph allowlist. The README's own sync requirement instructs keeping the tool list current. Update flowise/README.md's tool table and the "11 Workday tools" count to include `get_current_user_payslips` and `get_payslip_by_worker_id`.</comment>

<file context>
@@ -729,7 +729,7 @@
               "agentSelectedToolConfig": {
                 "mcpServerConfig": "{\n  \"key\": \"wd-mcp-server\",\n  \"url\": \"https://YOUR_MCP_SERVER_URL/mcp\",\n  \"headers\": {\n    \"Authorization\": \"Bearer YOUR_MCP_API_KEY\"\n  },\n  \"approvalPolicy\": \"always\"\n}",
-                "mcpActions": "[\"find_employee_id_by_name\",\"get_current_user_info\",\"get_current_user_time_off_balance\",\"get_current_user_time_off_history\",\"get_direct_reports\",\"get_more_employee_data\",\"get_my_time_off_eligibility\",\"get_personal_information\",\"get_today_date_and_day_of_week\",\"request_my_time_off\",\"get_time_off_balance\"]",
+                "mcpActions": "[\"find_employee_id_by_name\",\"get_current_user_info\",\"get_current_user_payslips\",\"get_current_user_time_off_balance\",\"get_current_user_time_off_history\",\"get_direct_reports\",\"get_more_employee_data\",\"get_my_time_off_eligibility\",\"get_payslip_by_worker_id\",\"get_personal_information\",\"get_today_date_and_day_of_week\",\"request_my_time_off\",\"get_time_off_balance\"]",
                 "agentSelectedTool": "customMCP"
               }
</file context>

Comment on lines +54 to +55
# 2. Worker lookup: WK001 specific periods
feb_slip = get_payslip_by_worker_id("WK001", "2026-02")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 These checks now call get_payslip_by_worker_id, while get_current_user_payslips is only called without a period. CI can pass if the current-user period match or missing-period branch breaks. Keep checks for both branches of get_current_user_payslips.

Knowledge Base Used: MCP demo data model

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 2 files (changes from recent commits).

Confidence score: 5/5

  • bridge-service/tests/check_payslips.py no longer calls get_current_user_payslips(period), leaving the period-filter and missing-period error branches in mcp-demo-server/main.py untested and allowing regressions in those paths to go unnoticed — restore targeted coverage for both cases.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="bridge-service/tests/check_payslips.py">

<violation number="1" location="bridge-service/tests/check_payslips.py:52">
P3: The latest delta removed all calls to `get_current_user_payslips(period)`, so the period-filter and missing-period error branches of that tool (mcp-demo-server/main.py:223-241) are no longer covered; only the equivalent paths of `get_payslip_by_worker_id` are tested. Add back a period and a missing-period call for the current user (WK via the fixture) so the current-user tool keeps its own branch coverage, and keep at least one exact-value assertion so mock-data corruption is caught.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

all_slips = get_current_user_payslips()
assert "payslips" in all_slips, f"Expected payslips list, got {all_slips}"
assert all_slips["worker_id"] == CURRENT_USER_WORKER_ID
assert len(all_slips["payslips"]) >= 1, f"Expected at least 1 slip for {CURRENT_USER_WORKER_ID}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The latest delta removed all calls to get_current_user_payslips(period), so the period-filter and missing-period error branches of that tool (mcp-demo-server/main.py:223-241) are no longer covered; only the equivalent paths of get_payslip_by_worker_id are tested. Add back a period and a missing-period call for the current user (WK via the fixture) so the current-user tool keeps its own branch coverage, and keep at least one exact-value assertion so mock-data corruption is caught.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At bridge-service/tests/check_payslips.py, line 52:

<comment>The latest delta removed all calls to `get_current_user_payslips(period)`, so the period-filter and missing-period error branches of that tool (mcp-demo-server/main.py:223-241) are no longer covered; only the equivalent paths of `get_payslip_by_worker_id` are tested. Add back a period and a missing-period call for the current user (WK via the fixture) so the current-user tool keeps its own branch coverage, and keep at least one exact-value assertion so mock-data corruption is caught.</comment>

<file context>
@@ -44,42 +49,38 @@ def main() -> None:
-    assert all_slips["payslips"][0]["currency"] == "CNY"
-    assert all_slips["payslips"][0]["gross_pay"] == 35000
-    assert all_slips["payslips"][0]["net_pay"] == 25200
+    assert len(all_slips["payslips"]) >= 1, f"Expected at least 1 slip for {CURRENT_USER_WORKER_ID}"
 
-    # 2. Current user specific period (February 2026)
</file context>
Suggested change
assert len(all_slips["payslips"]) >= 1, f"Expected at least 1 slip for {CURRENT_USER_WORKER_ID}"
assert len(all_slips["payslips"]) >= 1, f"Expected at least 1 slip for {CURRENT_USER_WORKER_ID}"
# Re-exercise the current-user period filter and missing-period error branches
feb_current = get_current_user_payslips("2026-02")
assert feb_current.get("period") == "2026-02", f"Expected 2026-02, got {feb_current}"
assert feb_current.get("net_pay") == 25200
missing_current = get_current_user_payslips("2025-12")
assert "error" in missing_current, f"Expected error for 2025-12, got {missing_current}"

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.

2 participants