Skip to main content
Glama

Sum payslips

well_sum_payslips
Read-only

The payroll total of a window of whole months, summed on the server from the payslips: gross pay, net pay, employee deductions, employer charges and the payslip cost, one group per currency, and per month when axes holds "month". It draws nothing.

Use it for any payroll or payslip total: "what did payroll cost last month", "total employer charges this quarter", "masse salariale", "coût employeur total". State the figures it returns and never add payslip amounts yourself, and never sum payslips with well_query_records or a records statistic: this read applies one rule on every surface, so the same question gives the same figure. For the payslips behind a figure, read the rows with well_show_records.

The window is from (inclusive) to to (exclusive), each the first day of a month as YYYY-MM-01, at most 12 months, cut on the pay period end. One month is from: "2026-09-01", to: "2026-10-01".

The rule is fixed, and rule echoes it. Statuses summed: approved and paid, and a payslip with no status, unless statuses names others. employee_deductions adds each deduction line by its magnitude; employer_charges adds the charge lines as printed, so a negative one is a reversal. Memo lines count nowhere. payslip_cost is gross_pay + employer_charges.

Every figure is per currency and never converted. Do not add two groups of different currencies.

What the figures leave out is returned so you can say it: gross_unread_count and net_unread_count (payslips that printed no amount there, in no total: say unread, never zero), printed_lines_incomplete_count (payslips whose extraction could not keep every printed line, so the total is built from the lines Well kept: say the total is incomplete, never call it the full payroll), unclassified_line_count and unclassified_line_amount (lines with no side, in no side total), held_back (payslips of other statuses, by status: drafts, pending, cancelled), unplaced_count (no pay period end, in no window) and no_currency_count.

People floor. On a WhatsApp turn each amount needs at least 3 people (distinct employment contracts) behind it: payslips that printed it for gross_pay and net_pay, deduction or charge lines for employee_deductions and employer_charges, both of those for payslip_cost. A person counts toward an amount only when their share of it is not zero: a payslip or line of 0.00, or none, adds no one. An amount under 3 people, or a total over several months where one month is under 3 people for it, is null and listed in suppressed as { amount, reason: "below_people_floor" }. An amount no person is behind at all (no payslip gives a non-zero amount for it that the sum adds up: no non-zero gross or net pay, or no non-zero deduction or charge line) is null with reason: "not_printed". unclassified_line_amount is always null there (reason: "not_on_whatsapp"). State the amounts that remain. For each suppressed entry, name the amount and its reason in one plain line: below_people_floor is hidden on WhatsApp so no one's pay can be worked out, not_printed means no payslip line gives it an amount the sum can add up (the header tax withheld and social contributions are never added, so the payslips may still print them, and a line of 0.00 may be printed: never say that no line or no amount was printed; a not_printed payslip_cost has no total because the part it adds that is also not_printed, most often the employer charges, gives no such amount), not_on_whatsapp means the lines with no side, whose amount shows in Well. Then give records_url once per workspace, under that workspace's totals, as the link to see its hidden amounts in Well: each workspace has its own link, so never point one workspace's hidden amounts to another's. When it is null, name the Well web app with no link. On WhatsApp payslip_count and contract_count are null and meets_people_floor says whether at least 3 people of the group have a non-zero gross or net pay: never state or guess a headcount there. On WhatsApp omit statuses; the read refuses it there. Never rebuild a held-back amount from other reads, other amounts or other windows. There is no per-person total.

partial: true means part of the payroll is not in the figures, and partial_reasons says why: read_cut_short (a read was cut short and a figure may be a floor) or currency_cap (the window holds more than 4 currencies; currencies_not_summed names those in no group, so say they are left out) or deadline (the read ran out of time: months_not_summed names the months in no group, so say those months are missing and never read them as zero; a month with no group that is not listed there had no payslip to sum) or printed_lines_incomplete (a payslip of the total kept fewer printed lines than its extraction read, so the total may be missing a line: say so, and name the count from printed_lines_incomplete_count). When success is false the read failed: the empty groups is not a measured zero.

When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.

Input Schema

NameRequiredDescriptionDefault
toYesEXCLUSIVE end of the window: the first day of the month after the last one, YYYY-MM-01.
axesNo["month"] for one group per month and currency. Omit for one group per currency over the window.
fromYesInclusive start of the window: the first day of a month, YYYY-MM-01.
statusesNoThe payslip statuses to sum. Omit for the rule's default (approved, paid and no status).
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose which.
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.

Output Schema

NameRequiredDescriptionDefault
axesYes
ruleYes
errorNo
groupsYes
windowYes
partialYes
successYes
statusesYes
held_backYes
records_urlYes
unplaced_countYes
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
partial_reasonsYes
months_not_summedYes
no_currency_countYes
no_status_countedYes
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
people_floor_appliedYes
currencies_not_summedYes
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedOutput schema / properties / groups / items / properties / printed_lines_incomplete_count
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / properties / groups / items / required
      Previous value: -[
      -  "month",
      -  "currency",
      -  "payslip_count",
      -  "contract_count",
      -  "meets_people_floor",
      -  "gross_unread_count",
      -  "net_unread_count",
      -  "unclassified_line_count",
      -  "gross_pay",
      -  "net_pay",
      -  "employee_deductions",
      -  "employer_charges",
      -  "payslip_cost",
      -  "unclassified_line_amount",
      -  "suppressed"
      -]New value: +[
      +  "month",
      +  "currency",
      +  "payslip_count",
      +  "contract_count",
      +  "meets_people_floor",
      +  "gross_unread_count",
      +  "net_unread_count",
      +  "printed_lines_incomplete_count",
      +  "unclassified_line_count",
      +  "gross_pay",
      +  "net_pay",
      +  "employee_deductions",
      +  "employer_charges",
      +  "payslip_cost",
      +  "unclassified_line_amount",
      +  "suppressed"
      +]
    • changedOutput schema / properties / partial_reasons / items / enum
      Previous value: -[
      -  "read_cut_short",
      -  "currency_cap",
      -  "deadline"
      -]New value: +[
      +  "read_cut_short",
      +  "currency_cap",
      +  "deadline",
      +  "printed_lines_incomplete"
      +]
  2. Changed26 schema fields changed
    • removedOutput schema / properties / groups / items / properties / contract_count / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / contract_count / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / employee_deductions / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / employee_deductions / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / employer_charges / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / employer_charges / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / gross_pay / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / gross_pay / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / month / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / month / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / net_pay / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / net_pay / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / payslip_cost / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / payslip_cost / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / payslip_count / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / payslip_count / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / groups / items / properties / unclassified_line_amount / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / groups / items / properties / unclassified_line_amount / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / no_currency_count / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / no_currency_count / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / records_url / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / records_url / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / resolved_workspace / properties / name / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / resolved_workspace / properties / name / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / unplaced_count / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / unplaced_count / type
      Added value: +[
      +  "number",
      +  "null"
      +]
  3. Changed3 schema fields changed
    • changedOutput schema / properties / groups / items / properties / suppressed / items / properties / reason / enum
      Previous value: -[
      -  "below_people_floor",
      -  "not_on_whatsapp"
      -]New value: +[
      +  "below_people_floor",
      +  "not_on_whatsapp",
      +  "not_printed"
      +]
    • addedOutput schema / properties / records_url
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "window",
      -  "axes",
      -  "statuses",
      -  "no_status_counted",
      -  "groups",
      -  "held_back",
      -  "unplaced_count",
      -  "no_currency_count",
      -  "people_floor_applied",
      -  "partial",
      -  "partial_reasons",
      -  "currencies_not_summed",
      -  "months_not_summed",
      -  "rule",
      -  "success"
      -]New value: +[
      +  "window",
      +  "axes",
      +  "statuses",
      +  "no_status_counted",
      +  "groups",
      +  "held_back",
      +  "unplaced_count",
      +  "no_currency_count",
      +  "people_floor_applied",
      +  "partial",
      +  "partial_reasons",
      +  "currencies_not_summed",
      +  "months_not_summed",
      +  "rule",
      +  "success",
      +  "records_url"
      +]
  4. Changed1 schema field changed
    • changedOutput schema / properties / newly_connected / description
      Previous value: -"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."New value: +"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."
  5. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnly/non-destructive/closed-world; the description goes far beyond by disclosing the fixed summing rule (statuses included, deduction magnitudes, employer charges as printed, memo lines excluded), the people-floor suppression behavior, the `partial`/`partial_reasons` failure modes, and that `success: false` means failure rather than a measured zero. This is exactly the context annotations cannot carry, and nothing contradicts them.

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

Conciseness3/5

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

The purpose is front-loaded and bold section headers (window, rule, what is left out, people floor, partial) make it navigable. But the definition runs to roughly a thousand words, with long parenthetical asides on how to phrase suppressed amounts — much of it reads as response-composition guidance rather than tool-selection information, and several clauses restate the same instruction twice.

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 7-parameter aggregation tool with an output schema, everything an agent needs to call and interpret it correctly is present: window arithmetic, grouping, suppression and null handling, partial-result causes, and failure semantics. Nothing material is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond it: the window is capped at 12 months and cut on pay period end, `axes: ["month"]` produces per-month groups, and `statuses` overrides the default approved/paid/no-status rule and is refused on WhatsApp. `conversation_id` and `workspace_scope` semantics are left to the schema, which already documents them.

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?

States a specific verb and resource with scope: payroll totals summed server-side from payslips across gross pay, net pay, deductions, employer charges and payslip cost, grouped per currency (and per month with `axes`). It explicitly separates itself from `well_query_records` (never sum there) and `well_show_records` (rows behind a figure), so an agent can pick it without opening the 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?

Names the canonical use cases verbatim ("what did payroll cost last month", "masse salariale") and explicit exclusions (never sum payslips yourself, never via a records statistic; use `well_show_records` for the underlying rows). It also gives call-context routing: call directly with one authorized workspace, pass `workspace_id` when several are authorized.

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.

Resources