field-time-exceptions
Supports SAP field time exception workflows by detecting time-entry exceptions in an SAP SuccessFactors landscape and queuing affected work orders for the SAP team to void or review before void, without directly changing ERP data.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Field Time Exception Agent
An MCP server that lets an AI agent find and help resolve field technicians' time-entry exceptions before time reaches the payroll and time system (for example, WorkForce Software in an SAP SuccessFactors landscape).
The agent detects problems, explains them, and proposes fixes. A manager must approve every change before it's applied, and every action is recorded in an audit trail.
All data is synthetic.
The problem
Field technicians charge time to work orders. Three kinds of errors are common and costly:
Exception | Example | Default fix |
Overlap | Two work orders both charged 11:30–12:30 | Split the overlap equally |
Prep / clean-up window | Work-order time charged inside the blocked 08:00–08:30 prep or 15:30–16:00 clean-up window | Trim to the window edge |
Opex → Capex | A maintenance (Opex) job becomes capital (Capex) work mid-day | Move the time to the Capex work order; queue the Opex work order for the SAP team to void, or to review if other time still charges to it |
Related MCP server: commerce-ops-harness
Architecture
flowchart LR
U["Manager or time analyst"] -->|asks in plain language| C["AI client<br/>(Claude desktop app)"]
C <-->|"MCP tools (stdio)"| S["MCP server<br/>server.py"]
S --> R["Rules engine<br/>rules.py<br/>(deterministic)"]
S --> D[("Synthetic data<br/>employees, work orders,<br/>time entries")]
S -->|write| L[("Exception log, proposals,<br/>manager outbox, audit log")]
A["Manager approval<br/>approve.py<br/>(outside the agent)"] -->|approve / reject| L
S -->|"apply only if approved"| X[("Corrected time entries")]
S -->|queue| V[("Work orders for the SAP team:<br/>Void or Review before void")]Rules find the facts; the AI handles judgment. Detection and counts are deterministic code. The model explains, prioritizes, drafts messages, and reasons about cases the rules don't cover, such as time charged after a job's cutover date or an entry caught by two exceptions at once.
Tools
Tool | Type |
| Read |
| Read: runs the rules, returns each exception with a default fix |
| Read: exact counts by type and manager, so summaries never rely on the model's arithmetic |
| Read: everything that happened to a proposal or exception |
| Write: exception log only |
| Write: outbox only |
| Write: creates a pending proposal; changes no time data |
| Write: works only after the employee's manager approves |
Governance built in
No unapproved changes. Writes are limited to logs and pending proposals until a manager approves.
Only the right approver. Only the employee's own manager can approve, and time dated in the future can't be approved.
Source data is never edited. Corrections go to a separate file.
The agent never changes ERP data. Work orders are only queued for the SAP team, and marked "Void" only when no other time remains on them; otherwise "Review before void", with the remaining charges listed.
Everything is audited, and the AI client asks permission before each tool call.
Lessons from testing
The model miscounted in an early summary ("10 exceptions" when its own tables showed 11). Fix: a
summarize_exceptionstool, and server instructions to use its numbers.The agent caught a flaw in the rules. The first version flagged a parent work order for voiding while other technicians still had time on it. The agent's reasoning spotted this, and because it could only propose, the approval step stopped it before any harm. The rule now checks for remaining charges, both when proposing and again when applying.
Setup (Windows, PowerShell)
Requires Python 3.10+.
cd field-time-agent
py -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtTry it
Run the end-to-end test:
python test_client.pyConnect an AI client. In the Claude desktop app, open Settings → Desktop app → Extensions → Edit config, and add (with your own paths):
"mcpServers": { "field-time-exceptions": { "command": "C:/path/to/field-time-agent/.venv/Scripts/python.exe", "args": ["C:/path/to/field-time-agent/server.py"] } }Restart the app, then ask: "Summarize this week's field time exceptions by type and manager, then propose corrections for the Opex-to-Capex ones."
Approve as a manager:
python approve.pylists pending proposals;python approve.py PR0001 approve M203approves one.Explore the tools in a browser (needs Node.js):
npx @modelcontextprotocol/inspector python server.py
To reset, delete the generated files in data/: exception_log.json, proposals.json,
outbox.json, audit_log.json, time_entries_corrected.csv, work_orders_to_void.json.
What's here
File | Purpose |
| The MCP server and its 11 tools |
| Detection rules, default corrections and counts |
| Manager approval, the human-in-the-loop step, outside the agent |
| End-to-end test acting as an MCP client |
| Recreates the synthetic data (20 technicians, 144 entries, 11 planted exceptions) |
| Employees, work orders, time entries, shift rules, and the answer key |
Roadmap
Move the model to SAP Generative AI Hub (SAP AI Core) and ground it on shift rules and SOPs.
Build the agent in SAP Joule Studio, calling the same tools.
Replace CSV files with S/4HANA and SuccessFactors APIs through SAP Integration Suite.
Cutover-date rule: move all time after a job turns capital, not just the same day's.
Change log
v2 (Nov 2026): safer void rule, re-checked at apply time;
summarize_exceptionsandget_audit_trailtools; approval blocked for future-dated time; expanded test.v1 (Nov 2026): 9 tools; rules for overlaps, prep/clean-up windows and Opex-to-Capex; manager approval and audit log.
License
MIT. Built by Bipin Premachandran.
This server cannot be deployed
Maintenance
Related MCP Connectors
Human-in-the-loop review and approval for AI agents. Audit trail, approval policies, native MCP.
Field workforce scheduling for AI agents. GPS punches, forms, timesheets. No dashboard.
Accounts-payable exception environment with a pass/fail verifier and proof packet: AI agents work AP
Connect, monitor, and control AI agents — tasks, approvals, schedules, and governance.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered analysis of exceptions using vector similarity search and Azure OpenAI for operations teams.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to investigate and resolve operational exceptions across orders, payments, inventory, and fulfillment through a multi-system truth and guarded actions.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to investigate and resolve e-commerce order exceptions like damages, lost shipments, refunds, and replacements through a unified interface with built-in guardrails.ISC
- AlicenseAqualityAmaintenanceAuditable records of human decisions over AI agent work. Approvals, edits, overrides, escalations.39122Apache 2.0