Deputy MCP by usefulapi

v1.41.1
io.usefulapi/deputy Checked 1 day ago Published 6 hours ago

See rosters, timesheets, leave and staff in Deputy, and create shifts, leave and memos.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

deputy_whoami Who am I

Return the Deputy user the token belongs to — name, employee id, company and permissions. A cheap way to confirm DEPUTY_INSTALL and the token are right. Deputy: GET /api/v1/me.

deputy_list_locations List locations

List the install's locations (workplaces). Deputy calls a location a Company; its Id is what other tools take as location_id. Deputy: GET /api/v1/resource/Company.

deputy_list_areas List areas

List areas (Deputy OperationalUnits — the rosterable sections of a location, e.g. Kitchen, Front of house). Shifts and timesheets belong to an area. Optionally only one location's areas. Deputy: GET /api/v1/resource/OperationalUnit, or POST .../OperationalUnit/QUERY when filtered.

ParameterTypeDescription
activebooleanOnly active (true) or inactive (false) areas.
location_idintegerOnly areas of this location (Company id).
maxintegerPage size, 1-500 (Deputy's cap). Default 100.
startintegerPagination offset (0-based). Pass the previous page's next_start.

deputy_list_employees List employees

Search employees by name, location or active status. Returns Id, DisplayName, Company (main location), Active, StartDate, Role and more. Deputy: POST /api/v1/resource/Employee/QUERY.

ParameterTypeDescription
activebooleantrue = current staff only; false = terminated/inactive only.
location_idintegerOnly employees whose main location is this Company id.
maxintegerPage size, 1-500 (Deputy's cap). Default 100.
name_containsstringOnly employees whose DisplayName contains this text.
startintegerPagination offset (0-based). Pass the previous page's next_start.

deputy_get_employee Get one employee

Fetch one employee's details as a supervisor sees them — contact, locations, role and employment. Deputy: GET /api/v1/supervise/employee/{id}.

ParameterTypeDescription
employee_id *integerThe employee id.

deputy_list_shifts List shifts

Search the roster (scheduled shifts) by time window, employee, area, and published/open state. Each record has StartTime/EndTime (unix), StartTimeLocalized, Employee (0 or null when open), OperationalUnit (area), Published, Open, Cost and _DPMetaData with names. Deputy: POST /api/v1/resource/Roster/QUERY.

ParameterTypeDescription
area_idintegerOnly shifts in this area (OperationalUnit id).
employee_idintegerOnly this employee's shifts.
fromOnly shifts starting at or after this time: a unix timestamp in seconds, or an ISO 8601 date/datetime (include an offset for local times).
maxintegerPage size, 1-500 (Deputy's cap). Default 25; page through with next_start.
openbooleantrue = open (unfilled) shifts only.
publishedbooleantrue = published only; false = drafts only.
startintegerPagination offset (0-based). Pass the previous page's next_start.
toOnly shifts starting at or before this time: a unix timestamp in seconds, or an ISO 8601 date/datetime (include an offset for local times).

deputy_get_shift Get one shift

Fetch one shift (Roster record) by id. Deputy: GET /api/v1/resource/Roster/{id}.

ParameterTypeDescription
shift_id *integerThe shift (Roster) id.

deputy_list_timesheets List timesheets

Search timesheets (actual worked time) by time window, employee, area and approval state. Each record has StartTime/EndTime (unix; EndTime null while in progress), TotalTime (hours), Cost, TimeApproved, PayRuleApproved, IsInProgress, IsLeave, Roster (linked shift) and Exported. Deputy: POST /api/v1/resource/Timesheet/QUERY.

ParameterTypeDescription
area_idintegerOnly timesheets in this area (OperationalUnit id).
employee_idintegerOnly this employee's timesheets.
fromOnly timesheets starting at or after this time: a unix timestamp in seconds, or an ISO 8601 date/datetime (include an offset for local times).
in_progressbooleantrue = only people currently on the clock.
maxintegerPage size, 1-500 (Deputy's cap). Default 25; page through with next_start.
pay_approvedbooleanFilter on PayRuleApproved (approved for payroll export).
startintegerPagination offset (0-based). Pass the previous page's next_start.
time_approvedbooleanFilter on TimeApproved (supervisor approved the times).
toOnly timesheets starting at or before this time: a unix timestamp in seconds, or an ISO 8601 date/datetime (include an offset for local times).

deputy_get_timesheet Get one timesheet

Fetch one timesheet's full details, including breaks and approval state. Deputy: GET /api/v1/supervise/timesheet/{id}/details.

ParameterTypeDescription
timesheet_id *integerThe timesheet id.

deputy_list_leave List leave requests

Search leave requests by employee, location, status and time window. Status: 0 awaiting approval, 1 approved, 2 declined, 3 cancelled, 4 date approved without pay, 5 pay approved without date. Start/End are unix; LeaveRule is the leave type id. Deputy: POST /api/v1/resource/Leave/QUERY.

ParameterTypeDescription
employee_idintegerOnly this employee's leave.
fromOnly leave starting at or after this time: a unix timestamp in seconds, or an ISO 8601 date/datetime (include an offset for local times).
location_idintegerOnly leave against this location (Company id).
maxintegerPage size, 1-500 (Deputy's cap). Default 25; page through with next_start.
startintegerPagination offset (0-based). Pass the previous page's next_start.
statusintegerOnly this status (0-5, see description).
toOnly leave starting at or before this time: a unix timestamp in seconds, or an ISO 8601 date/datetime (include an offset for local times).

deputy_get_employee_unavailability Get an employee's unavailability

List the times one employee has marked themselves (or been marked) unavailable to work — check before rostering them. Deputy: GET /api/v1/supervise/unavail/{employeeId}.

ParameterTypeDescription
employee_id *integerThe employee id.

deputy_query_resource Query any Deputy resource

Run a Resource API search on any business object (leave types, pay rules, public holidays, memos, events, shift templates, pay lines, availability, sales data, …). `search` is Deputy's clause map, e.g. {"s1":{"field":"Employee","data":12,"type":"eq"}}; operators: eq ne gt lt ge le is 'is not' in 'not in' starts contains. Use deputy_describe_resource to see an object's fields and joins. Read-only. Deputy: POST /api/v1/resource/{Object}/QUERY.

ParameterTypeDescription
object *stringResource API object. Deputy names: Company = location, OperationalUnit = area, Roster = shift, LeaveRules = leave types, TimesheetPayReturn = approved pay lines.
joinarrayRelated objects to expand inline, e.g. ["TimesheetObject"] on TimesheetPayReturn.
maxintegerPage size, 1-500 (Deputy's cap). Default 25, or 10 when join is set (joined records are larger); page through with next_start.
searchobjectClauses keyed by any id (s1, s2, …). All must match.
sortobjectField → asc/desc, e.g. {"Id":"desc"}.
startintegerPagination offset (0-based). Pass the previous page's next_start.

deputy_describe_resource Describe a Deputy resource

Return a Resource API object's field list, field types and joinable associations — what deputy_query_resource can filter, sort and join on. Deputy: GET /api/v1/resource/{Object}/INFO.

ParameterTypeDescription
object *stringResource API object. Deputy names: Company = location, OperationalUnit = area, Roster = shift, LeaveRules = leave types, TimesheetPayReturn = approved pay lines.

deputy_create_shift Create a shift

Add a shift to the roster, assigned to an employee or left open. Created as a DRAFT unless publish is true (publishing can notify the employee). Deputy returns an empty 200 on success — use deputy_list_shifts to find the new shift's id. Deputy: POST /api/v1/supervise/roster.

ParameterTypeDescription
area_id *integerArea (OperationalUnit id) the shift is for.
end_time *Shift end: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
start_time *Shift start: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
commentstringComment shown on the shift.
confirmedbooleanMark the shift as confirmed.
employee_idintegerEmployee to put on the shift. Omit (and set open: true) for an unfilled shift.
force_overwritebooleanOverwrite a clashing shift for the same employee. Default false.
mealbreak_minutesintegerUnpaid meal break length in minutes.
openbooleanShow the shift as open for employees to claim.
publishbooleanPublish now. Publishing can notify the employee. Default false (draft).

deputy_update_shift Update a shift

Change an existing shift's times, area, employee, break or comment. Send the full intended shift (same fields as create) — Deputy's update is the add call with the shift id. Deputy: POST /api/v1/supervise/roster with intRosterId.

ParameterTypeDescription
area_id *integerArea (OperationalUnit id) the shift is for.
end_time *Shift end: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
shift_id *integerThe shift (Roster) id.
start_time *Shift start: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
commentstringComment shown on the shift.
confirmedbooleanMark the shift as confirmed.
employee_idintegerEmployee to put on the shift. Omit (and set open: true) for an unfilled shift.
force_overwritebooleanOverwrite a clashing shift for the same employee. Default false.
mealbreak_minutesintegerUnpaid meal break length in minutes.
openbooleanShow the shift as open for employees to claim.
publishbooleanPublish now. Publishing can notify the employee. Default false (draft).

deputy_publish_shifts Publish shifts

Publish draft shifts so employees see them, choosing how they are notified: 1 SMS and email, 2 SMS, 3 email, 4 no notification, 5 confirmation required. Only the listed shift ids are published. Deputy: POST /api/v1/supervise/roster/publish.

ParameterTypeDescription
notify_mode *integer1 SMS+email, 2 SMS, 3 email, 4 none, 5 confirmation required.
shift_ids *arrayRoster ids to publish.

deputy_create_leave_request Create a leave request

Add a leave request for an employee. By default it waits for manager approval (status 0); pass status 1 only when your system is the source of truth and the leave is already approved. Deputy tracks leave in hours, so give exact start and end times. Find leave type ids with deputy_query_resource on LeaveRules. Deputy: POST /api/v1/resource/Leave.

ParameterTypeDescription
comment *stringThe employee's note to the manager.
employee_id *integerThe employee id.
end_date *stringLast day, YYYY-MM-DD.
end_time *Leave end: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
leave_rule_id *integerLeave type (LeaveRules id), e.g. annual leave.
location_id *integerLocation (Company id) the leave is recorded against.
start_date *stringFirst day, YYYY-MM-DD.
start_time *Leave start: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
approval_commentstringManager's comment, when status is 1.
status0 awaiting approval (default), 1 already approved.

deputy_add_unavailability Add unavailability for an employee

Record a time an employee cannot work (one-off, or recurring with an RFC 5545-style rule such as FREQ WEEKLY, INTERVAL 1, BYDAY MO). Auto-scheduling then skips them. Deputy: POST /api/v1/supervise/unavail.

ParameterTypeDescription
employee_id *integerThe employee id.
end_time *Unavailability end: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
start_time *Unavailability start: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
commentstringNote the manager sees. Default empty.
recurrenceobjectOmit for a one-off block.

deputy_create_memo Post a memo

Post a memo to a location's news feed, optionally requiring staff to confirm they read it, or targeted to specific locations or users. Visible to staff immediately. Deputy: PUT /api/v1/supervise/memo.

ParameterTypeDescription
content *stringThe memo text.
location_id *integerLocation (Company id) to post to.
location_idsarrayAlso show at these locations.
require_confirmbooleanAsk staff to confirm they have read it. Default false.
user_idsarrayOnly these USER ids (not employee ids) receive it.

deputy_update_timesheet Update a timesheet

Correct an existing timesheet's start/end time, area, meal break or supervisor comment. Times cannot be in the future. Deputy: POST /api/v1/supervise/timesheet/update.

ParameterTypeDescription
area_id *integerArea (OperationalUnit id) the time was worked in.
end_time *Timesheet end: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
start_time *Timesheet start: a unix timestamp in seconds, or an ISO 8601 datetime (include an offset for local times).
timesheet_id *integerThe timesheet id.
commentstringComment attached to the timesheet.
mealbreak_minutesintegerTotal unscheduled meal break, minutes.

deputy_approve_timesheet Approve a timesheet

Approve one timesheet's times as a supervisor. Approved timesheets flow toward payroll export, so check it first with deputy_get_timesheet. Deputy: POST /api/v1/supervise/timesheet/approve.

ParameterTypeDescription
timesheet_id *integerThe timesheet id.