HR

Approve, decline or cancel leave

hr_decide_leave · Changes data · Markdown

Approves or declines a pending leave request, or cancels one that is pending or approved.

$0.01 a call

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

An example

Lena says yes to Tom's Christmas leave.

Your agent callshr_decide_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
{
  "request_id": 4142,
  "decision": "approve",
  "note": "Enjoy the holidays!"
}
What comes back
{
  "request": {
    "request_id": 4142,
    "person": {
      "person_id": 4102,
      "name": "Tom Okafor"
    },
    "leave_type": "Vacation",
    "paid": true,
    "start": "2026-12-21",
    "end": "2026-12-31",
    "half_start": false,
    "half_end": true,
    "days": "7.5",
    "hours": "60",
    "by_leave_year": {
      "2026": "7.5"
    },
    "status": "approved",
    "note": "Christmas with family",
    "decision_note": "Enjoy the holidays!",
    "decided_by": "Pip",
    "decided_at": "2026-10-14T08:00:00+00:00",
    "allow_negative": false,
    "created_at": "2026-10-14T08:00:00+00:00"
  },
  "balances": [
    {
      "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": "0",
      "approved": "7.5",
      "balance": "20.5",
      "pending": "0",
      "available_after_pending": "20.5"
    }
  ]
}

Use it when

A manager decided, or plans changed.

What it does

Decide on a leave request: approve or decline one that is pending, or cancel one that is pending or approved (approved days go back to the balance). Declined and cancelled requests stay as they are; ask again with hr_request_leave. Approving checks the balance again; allow_negative: true lets it go below 0. Returns the request and the balance after it.

What comes back

request: the request with its new status; balances: the balance after it. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
request_idRequiredintegerAt least 1.
decisionRequiredstringOne of: approve,decline,cancel.
notestringUp to 1,000 characters.
allow_negativebooleanDefault: false.

The call

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

Terminal
curl -X POST https://api.conecto.chat/v1/tools/hr_decide_leave \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"request_id":4142,"decision":"approve","note":"Enjoy the holidays!"}'

When it refuses

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

CodeWhenWhat to do
not_found404No leave request has that request_id.Find it with hr_list_leave.
already_approved409The request is approved already.Cancel it instead to undo it.
already_declined409The request is declined.Ask again with hr_request_leave.
already_cancelled409The request is cancelled.Ask again with hr_request_leave.
outside_employment409The dates are outside the person's employment now.Cancel the request.
not_enough_days409The balance (after pending requests) cannot take the days.Ask for fewer days, or pass allow_negative: true if the owner agrees.

Give this to your agent.

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