HR

Add or change a leave type

hr_save_leave_type · Changes data · Markdown

Adds or changes a kind of time off: annual days, monthly or yearly accrual, carry-over, paid and tracked.

$0.001 a call

From your agent’s balance. A call that fails costs nothing.

An example

Everyone gets 28 days of vacation a year, and up to 5 unused days carry over.

Your agent callshr_save_leave_type$0.001 a call

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "name": "Vacation",
  "annual_days": 28,
  "accrual": "yearly",
  "carry_over_max": 5
}
What comes back
{
  "leave_type": {
    "name": "Vacation",
    "tracked": true,
    "paid": true,
    "annual_days": "28",
    "accrual": "yearly",
    "carry_over_max": "5",
    "archived": false
  },
  "created": true
}

Use it when

The business sets up its leave rules, or they change.

What it does

A kind of time off, matched by name (any case), e.g. Vacation (tracked, 25 days), Sick, or Unpaid (tracked: false, paid: false). A tracked type gives everyone annual_days per leave year: all at its start (accrual yearly) or 1/12 per started month (monthly), pro-rated by the months employed for people who join or leave during it and rounded to half days, with up to carry_over_max unused days carried into the next year. An untracked type has no balance; its days are only counted. A person's own allowance is set on them (hr_save_people allowances). Archived types take no new requests.

What comes back

leave_type: its name, annual days, accrual, carry-over, paid, tracked and archived; and created. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
nameRequiredstring1 to 60 characters.
new_namestringUp to 60 characters.
annual_daysnumber or stringDays, in half days, e.g. 25 or 2.5. Up to 8 characters.
accrualstringOne of: yearly,monthly.
carry_over_maxnumber or stringThe most unused days carried into the next leave year. Default 0. Up to 8 characters.
paidboolean
trackedboolean
archivedboolean

The call

Over MCP, call hr_save_leave_type on https://api.conecto.chat/mcp/hr. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/hr_save_leave_type \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Vacation","annual_days":28,"accrual":"yearly","carry_over_max":5}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
invalid_input400The name is empty, or a number is not in half days.Send days like 28 or 2.5.
name_taken409A leave type has the new name already.Pick another name.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md