Skip to main content
Glama

Render a caller-computed cost structure

well_render_cost_structure
Read-only

Put a cost breakdown YOU computed onto the cost-structure card.

This tool measures nothing. It takes the slices and the method behind them as input and returns them for rendering. Call it only after you have computed the breakdown yourself and can state every field below from your own work, never to "get" a cost structure.

The server derives no breakdown of its own. The chart draws the slices you state here, which is why every field below is required: the policy behind a grouping is the only thing that makes it checkable.

The card draws the ring, the legend and the month. Everything else you state below is REQUIRED and reaches no pixel. All of it comes back to you in this tool's text result, which is what you write the prose from. The chart is the measure; the explanation is yours.

REQUIRED, because a breakdown whose method is not stated cannot be checked:

  • entries: the slices, largest first, each a POSITIVE magnitude in currency. Send NO share: this tool derives every share from the amounts and returns them, and an entry carrying pct is refused as an unknown field. At most 4 named slices plus one rolled-up Other, because the card performs no rollup of its own

  • period_start and period_end: the INCLUSIVE bounds of the single calendar month covered. Never a quarter, never a span, never a month still running

  • rung: which grouping produced these categories. State it in prose too, so the reader knows whether they are looking at their own ledger's categories or Well's

  • label_provenance: whether a person owns those labels. A chart of accounts synced from an accounting tool is machine, not curated: the names came from the provider, not from anyone at the company

  • coverage: the outflow rows the elected grouping could label, against every outflow row the month held. This is the evidence the rung was elected on, and your prose states it

  • convention and convention_counts: which sign means money leaving, and the row counts you elected it from

  • excluded: what fell out, in four named groups. no_asset_movement is where CREDIT CARD SPEND lands, because the transfer rule drops a row with no owned asset leg and a credit card charge moves a liability. A debit card charge from a linked bank account has one asset leg, so it is an outflow like any other and is not in this group. It contains no_owned_leg, so never add them. Send an unmeasured LEG count as null rather than 0, because zero says the rule removed nothing, and one cancelled leg count nulls all three. unreadable_rows is always measured and takes a number. own_company is the sum's excluded_own_company: transfers to or from the same company's account in another workspace, which your prose names inside the internal-transfers group. Send it as the sum returned it, null included

REFUSED rather than rendered:

  • an entry carrying pct, or any other field this schema does not name. The shares are DERIVED here from the amounts, so a share you send is a second opinion the card has no way to reconcile

  • entries out of descending-amount order, more than 4 named slices, or an Other slice that is not last

  • a negative amount: a breakdown is made of magnitudes

  • a period_start/period_end pair that is not exactly one whole calendar month, or that names a month which has not ended

  • category_key on any rung but category_key, or on the rolled-up Other slice, which is many categories and is therefore not one of them

  • any label_provenance but unlabelled on a rung that carries no category: curated, machine and mixed each claim that someone or something chose labels the chart never shows. The converse is NOT refused, because a rung elects over the month's rows while the provenance describes the ones that survived into the slices, so a labelled rung whose labelled rows all dropped is legitimately unlabelled

  • rung: "uncategorised" sent beside named category slices, which is a breakdown claiming to be the absence of one

  • convention: "magnitude": that feed keeps direction in a field no grouping reaches, so no outflow was measured. signed elected from ZERO negative rows is the same finding, demonstrated rather than declared

  • coverage wider than the month it covers, or a labelled rung that could label no rows at all

  • one of excluded.internal_transfers, excluded.no_owned_leg and excluded.no_asset_movement null while the others are measured: one cancelled count nulls all three, and the refusal is filed against excluded.no_asset_movement

  • a currency outside ISO-4217: the code is checked against the catalog, not its shape

An EMPTY entries array is accepted, and it means nothing is categorized for that month. Say that, rather than reporting zero spend: a month with no outflow at all is a different answer and the card says so differently.

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

TableJSON Schema
NameRequiredDescriptionDefault
rungYesWhich grouping produced these categories.
entriesYesThe slices, largest first, with the rolled-up `Other` last when there is one.
coverageYesThe evidence the rung was elected on, so a reader can check the election rather than take it.
currencyYesISO-4217 code every amount is denominated in. Checked against the catalog, not its shape.
excludedYesThe four exclusion groups kept apart: the transfers the rule removed, the rows with no owned asset leg (credit card spend), the subset of those attributable to no account at all, and the rows dropped as unreadable. Merging them hides the difference between a rule and a defect.
conventionYesWhich sign the feed uses for an outflow. "magnitude" is refused: it measures no outflow.
period_endYesINCLUSIVE last day of that same month.
period_startYesINCLUSIVE first day of the month covered.
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.
label_provenanceYesWhether a person set or confirmed the labels the reader can see.
convention_countsYesThe row counts the convention was elected from.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rungYes
entriesYes
successYes
coverageYes
currencyYes
excludedYes
conventionYes
period_endYes
computed_byYes
period_startYes
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.
label_provenanceYes
convention_countsYes
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.
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. 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."
  2. Changed2 schema fields changed
    • addedInput schema / properties / excluded / properties / own_company
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 9007199254740991,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The sum's `excluded_own_company`: transfers to or from the workspace's own company at an account this workspace does not hold, such as the same company's account in another workspace. Named inside the internal-transfers group, never added to `internal_transfers`. `null` when it could not be counted or the workspace has no confirmed own company, never `0` in place of `null`. The count is a floor: the rule reads only legs on this workspace's own company record, so a transfer on an adopted parent's rows stays in the figure."
      +}
    • addedOutput schema / properties / excluded / properties / own_company
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / workspace_scope
      Added value: +{
      +  "description": "Restrict 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.",
      +  "enum": [
      +    "family"
      +  ],
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • addedOutput schema / properties / newly_connected
      Added value: +{
      +  "description": "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.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "name": {
      +        "type": "string"
      +      },
      +      "service_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "service_id"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  5. Changed2 schema fields changed
    • changedInput schema / properties / excluded / description
      Previous value: -"The four exclusion groups kept apart: the transfers the rule removed, the rows with no owned asset leg (card spend), the subset of those attributable to no account at all, and the rows dropped as unreadable. Merging them hides the difference between a rule and a defect."New value: +"The four exclusion groups kept apart: the transfers the rule removed, the rows with no owned asset leg (credit card spend), the subset of those attributable to no account at all, and the rows dropped as unreadable. Merging them hides the difference between a rule and a defect."
    • changedInput schema / properties / excluded / properties / no_asset_movement / description
      Previous value: -"The sum's `excluded_zero_leg`: rows the transfer rule dropped for carrying no owned ASSET leg. This is where card spend sits, because a card charge moves a liability and belongs to the later repayment. It is the widest of the three and CONTAINS `no_owned_leg`, so never add the two together. `null` when it could not be counted, never 0."New value: +"The sum's `excluded_zero_leg`: rows the transfer rule dropped for carrying no owned ASSET leg. This is where credit card spend sits, because a credit card charge moves a liability and belongs to the later repayment. A debit card charge from a linked bank account has one asset leg, so it is an outflow like any other and is not in this group. It is the widest of the three and CONTAINS `no_owned_leg`, so never add the two together. `null` when it could not be counted, never 0."
  6. Changed4 schema fields changed
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "The 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.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id_note
      Added value: +{
      +  "description": "Present only when the server opened a fresh lane, stating that no choice recorded earlier was read.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id_source
      Added value: +{
      +  "description": "Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.",
      +  "enum": [
      +    "host_meta",
      +    "argument",
      +    "minted"
      +  ],
      +  "type": "string"
      +}
  7. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources