HR

Adjust a leave balance

hr_adjust_leave · Changes data · Markdown

Adds days to, or takes days off, one person's balance of a tracked leave type, with the reason.

$0.01 a call

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

An example

Tom worked the Saturday market. Give him a day in lieu.

Your agent callshr_adjust_leave$0.01 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
{
  "person": "tom.okafor@hansenvoss.example",
  "leave_type": "Vacation",
  "days": 1,
  "reason": "Day in lieu for the Saturday market, October 10"
}
What comes back
{
  "person": {
    "person_id": 4102,
    "name": "Tom Okafor"
  },
  "balance": {
    "leave_type": "Vacation",
    "tracked": true,
    "paid": true,
    "year": 2026,
    "from": "2026-01-01",
    "to": "2026-12-31",
    "annual_days": "28",
    "own_allowance": false,
    "accrual": "yearly",
    "months_counted": 12,
    "entitlement": "28",
    "carried_over": "0",
    "adjustments": "1",
    "approved": "0",
    "balance": "29",
    "pending": "0",
    "available_after_pending": "29"
  }
}

Use it when

Leave taken before the business kept it here, a day in lieu, or a correction.

What it does

Add days to, or take days off, one person's balance of a tracked leave type in one leave year, with the reason: what they had already used or carried over when you started keeping their leave here, a day in lieu, a correction. Conecto counts from the leave year a person was added, so earlier history comes in this way. Returns the new balance.

What comes back

The person, and their balance of that leave type afterwards, with the adjustment in it. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
personRequiredinteger or stringThe person_id, or their work email. 1 to 254 characters, at least 1.
leave_typeRequiredstringA leave type by name, e.g. "Vacation". 1 to 60 characters.
daysRequirednumber or stringPositive adds, negative takes off, in half days, e.g. -12 or 1.5. Up to 8 characters.
reasonRequiredstring1 to 300 characters.
yearintegerA leave year, named by the year it starts in. Default: the current one. 2,000 to 2,100.

The call

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

Terminal
curl -X POST https://api.conecto.chat/v1/tools/hr_adjust_leave \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"person":"tom.okafor@hansenvoss.example","leave_type":"Vacation","days":1,"reason":"Day in lieu for the Saturday market, October 10"}'

When it refuses

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

CodeWhenWhat to do
not_found404No person of the business has that person_id or work email.Find them with hr_list_people.
not_found404No leave type has that name.Call hr_get_settings, or add it with hr_save_leave_type.
invalid_input400The days are 0 or not in half days, or there is no reason.Send days like 1 or -2.5 and a reason.
not_tracked409The leave type is not tracked, so it has no balance.Adjust a tracked type.
archived409The leave type is archived.Use a type that is in use.

Give this to your agent.

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