Brian Metrillo
Work

Staffing assistant

Answers who is free, prices projects, and books leave, so a team can run staffing by asking an AI.

Role
Lead engineer
Year
2026
Stack
TypeScript, MCP
Code
Private

Overview

The staffing assistant is a server that lets people ask an AI assistant who is free, what a project should cost, and when someone is out. I took over an early version and built its pricing, leave booking, audits, and confirmed writes.

Problem

People kept asking who was working on what and who had room for more. The scheduling records were often stale, so leaders learned about overbooked people or underscoped projects late. Staffing rules lived in a written playbook that nothing enforced, and pricing a project meant adding up staffing hours and costs by hand.

Approach

I started by mapping the existing data model against the questions people actually asked, then filled the gaps one job at a time. The server already split the work so that tools own the facts, the math, and the writes, and the assistant owns the conversation. I kept that split for every tool I added.

Pricing showed why. When the assistant did the arithmetic itself, the totals changed between runs, so the math moved into a pricing tool that gives the same answer every time.

How it works

Every request runs as a real person. People sign in with their work account, the server matches that sign-in to someone on the team, and their role decides which tools they can use. Members see and change only their own records, while managers also get pricing, audits, and changes for other people. The key to the underlying data stays on the server and never reaches the assistant.

Any change follows the same steps.

  1. 1The assistant asks for a change, like booking leave or adding someone to a project.
  2. 2The server checks the request and works out exactly what would change.
  3. 3It returns a preview and a token tied to that exact preview.
  4. 4The person approves, and the assistant sends the token back.
  5. 5The server rebuilds the preview, refuses the write if anything moved, and reads the record back after writing.

Pricing accounts for holidays and leave, and missing cost data stays missing instead of turning into zero. The audit only reads, and it flags records that break the staffing rules, like duplicates, dead bookings, and missing rates. Leave booking guards against retries, so a request that times out cannot book the same days twice.

Testing

Tests run the real server against an in-memory assistant client, with a fake data layer that fails on any call a test did not expect. Tests that write real data are opt in and run only against throwaway projects, and every change gets an automated review before it merges.

Outcome

The assistant can now price a project, book leave, audit the records, and make confirmed staffing changes, all through the same identity and approval checks. Several playbook rules that used to depend on people remembering them are now checked in code. Next is the daily hours cap, which today is only a warning and an audit finding.