Skip to main content
Glama

Spara anställd

upsert_employee
Destructive

Skapa eller uppdatera en anställd. Utan employee_id skapas en ny; med employee_id uppdateras den och BARA medskickade fält ändras. Personnummer tas inte emot här: användaren lägger in det i Kvickd under Lön > Anställda (det behövs innan lön kan köras), så be inte om det i chatten. Svaret visar personnumret maskerat och has_personnummer. Scope payroll. Argument: orgnr; valfritt employee_id, first_name, last_name, tax_table, tax_column, monthly_salary_ore, employer_fee_bps (standard 3142 = 31,42 %, som räknas om efter ålder ur personnumret vid lönekörningen; en annan sats används som den är), bank_account, active, note. Timanställda: hourly_rate_ore (timlön), overtime_rate_ore (ersättning per övertidstimme), ob_rate_ore (OB-tillägg per timme) och vacation_pay_bps (semesterersättning som betalas med varje lön, 1200 = 12 %); de används av get_payroll_time_basis. tax_percent_bps: skatteavdrag i procent enligt Skatteverkets jämkningsbeslut (3000 = 30 %), används i stället för skattetabellen; -1 tar bort procentsatsen så att tabellen gäller igen. salary_account: konto för den anställdas lön, t.ex. 7210 (tjänstemän) eller 7220 (företagsledare); 0 = bolagets konto för löner (get_payroll_accounts).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "orgnr": "<orgnr>"
    },
    "name": "upsert_employee"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNo
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
activeNo
last_nameNo
tax_tableNo
first_nameNo
tax_columnNo
employee_idNo
ob_rate_oreNo
bank_accountNo
salary_accountNo
hourly_rate_oreNo
tax_percent_bpsNo
employer_fee_bpsNo
vacation_pay_bpsNo
overtime_rate_oreNo
monthly_salary_oreNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / salary_account
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Salary Account"
      +}
    • addedInput schema / properties / tax_percent_bps
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tax Percent Bps"
      +}
  2. Changed1 schema field changed
    • removedInput schema / properties / personnummer
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Personnummer"
      -}
  3. Changed1 schema field changed
    • addedInput schema / properties / orgnr / description
      Added value: +"Bolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies."
  4. First observed

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations it discloses important behavior: partial-update semantics ('BARA medskickade fält ändras'), the masked response fields (personnummer masked plus has_personnummer), the default employer fee of 3142 bps being recalculated from age unless overridden, and how tax_percent_bps=-1 reverts to the tax table. It does not explicitly discuss the destructiveHint flag or reversibility of an update, which is the remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose, the create/update split and the personnummer constraint are front-loaded, and the parameter glosses are grouped sensibly. The middle section is a long comma chain that is dense but each clause carries usable semantics rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 17-parameter mutation with no output schema and near-zero schema descriptions, the definition covers the required field, the update-vs-create switch, unit conventions, sentinel values and cross-tool routing. An agent has enough to call it correctly without asking follow-up questions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 6%, so the description must carry the load, and it does: it explains units and defaults for employer_fee_bps, vacation_pay_bps, tax_percent_bps (including the -1 sentinel), salary_account values (7210/7220/0) and the hourly-rate family. Only tax_table, tax_column and the öre units of monthly_salary_ore are left implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb pair and resource ('Skapa eller uppdatera en anställd') and immediately splits the two modes by employee_id. An agent can distinguish this from delete_employee or calc_payroll without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states explicitly when a new record is created versus updated ('Utan employee_id skapas en ny; med employee_id uppdateras den'), and rules out a common misuse by saying personnummer must be entered by the user in Kvickd and must not be requested in chat. It also routes to siblings: get_payroll_time_basis for hourly staff fields and get_payroll_accounts for salary accounts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.