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. Under card_spend: "at_purchase", no_asset_movement holds no card spend (the purchases are in the slices), and card_settlement is the sum's excluded_card_settlement with the outflow per currency of excluded_card_settlement_sums under your convention: the card repayments left out because their purchases already count. Send count: null and amounts: null when it was not measured

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

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

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. Changed12 schema fields changed
    • removedOutput schema / properties / excluded / properties / card_settlement / properties / count / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / excluded / properties / card_settlement / properties / count / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / excluded / properties / internal_transfers / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / excluded / properties / internal_transfers / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / excluded / properties / no_asset_movement / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / excluded / properties / no_asset_movement / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / excluded / properties / no_owned_leg / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / excluded / properties / no_owned_leg / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / excluded / properties / own_company / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / excluded / properties / own_company / type
      Added value: +[
      +  "number",
      +  "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"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / excluded / properties / card_settlement
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Card repayments left out under `card_spend: \"at_purchase\"`, because the purchases they repay already sit in the slices. Omit it when the sums did not use that rule.",
      +  "properties": {
      +    "amounts": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "amount": {
      +                "minimum": 0,
      +                "type": "number"
      +              },
      +              "currency": {
      +                "enum": [
      +                  "USD",
      +                  "EUR",
      +                  "GBP",
      +                  "JPY",
      +                  "CHF",
      +                  "CAD",
      +                  "AUD",
      +                  "NZD",
      +                  "SEK",
      +                  "NOK",
      +                  "DKK",
      +                  "PLN",
      +                  "CZK",
      +                  "HUF",
      +                  "RON",
      +                  "BGN",
      +                  "HRK",
      +                  "ISK",
      +                  "ALL",
      +                  "BAM",
      +                  "BYN",
      +                  "MDL",
      +                  "MKD",
      +                  "RSD",
      +                  "FOK",
      +                  "GGP",
      +                  "GIP",
      +                  "IMP",
      +                  "JEP",
      +                  "CNY",
      +                  "CNH",
      +                  "KRW",
      +                  "SGD",
      +                  "HKD",
      +                  "TWD",
      +                  "THB",
      +                  "MYR",
      +                  "IDR",
      +                  "PHP",
      +                  "VND",
      +                  "INR",
      +                  "PKR",
      +                  "LKR",
      +                  "BDT",
      +                  "BND",
      +                  "BTN",
      +                  "KHR",
      +                  "LAK",
      +                  "MMK",
      +                  "MNT",
      +                  "MOP",
      +                  "MVR",
      +                  "NPR",
      +                  "KID",
      +                  "AED",
      +                  "SAR",
      +                  "QAR",
      +                  "KWD",
      +                  "BHD",
      +                  "OMR",
      +                  "JOD",
      +                  "ILS",
      +                  "EGP",
      +                  "ZAR",
      +                  "NGN",
      +                  "KES",
      +                  "GHS",
      +                  "MAD",
      +                  "TND",
      +                  "DZD",
      +                  "CVE",
      +                  "GMD",
      +                  "GNF",
      +                  "LRD",
      +                  "MGA",
      +                  "MRU",
      +                  "SHP",
      +                  "SLE",
      +                  "SLL",
      +                  "SSP",
      +                  "STN",
      +                  "YER",
      +                  "MXN",
      +                  "BRL",
      +                  "ARS",
      +                  "CLP",
      +                  "COP",
      +                  "PEN",
      +                  "UYU",
      +                  "VES",
      +                  "GTQ",
      +                  "HNL",
      +                  "NIO",
      +                  "CRC",
      +                  "PAB",
      +                  "DOP",
      +                  "JMD",
      +                  "TTD",
      +                  "BBD",
      +                  "XCD",
      +                  "ANG",
      +                  "AWG",
      +                  "BMD",
      +                  "BOB",
      +                  "BSD",
      +                  "BZD",
      +                  "CUP",
      +                  "GYD",
      +                  "HTG",
      +                  "KYD",
      +                  "PYG",
      +                  "SRD",
      +                  "XCG",
      +                  "FKP",
      +                  "FJD",
      +                  "PGK",
      +                  "SBD",
      +                  "TOP",
      +                  "TVD",
      +                  "VUV",
      +                  "WST",
      +                  "RUB",
      +                  "TRY",
      +                  "UAH",
      +                  "KZT",
      +                  "UZS",
      +                  "AZN",
      +                  "GEL",
      +                  "AMD",
      +                  "KGS",
      +                  "TJS",
      +                  "TMT",
      +                  "AFN",
      +                  "IRR",
      +                  "IQD",
      +                  "SYP",
      +                  "LBP",
      +                  "LYD",
      +                  "SDG",
      +                  "ETB",
      +                  "UGX",
      +                  "TZS",
      +                  "MWK",
      +                  "ZMW",
      +                  "BWP",
      +                  "SZL",
      +                  "LSL",
      +                  "NAD",
      +                  "MUR",
      +                  "SCR",
      +                  "KMF",
      +                  "DJF",
      +                  "ERN",
      +                  "SOS",
      +                  "AOA",
      +                  "MZN",
      +                  "ZWL",
      +                  "ZWG",
      +                  "BIF",
      +                  "RWF",
      +                  "CDF",
      +                  "XAF",
      +                  "XOF",
      +                  "XPF"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "currency",
      +              "amount"
      +            ],
      +            "type": "object"
      +          },
      +          "maxItems": 164,
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The outflow of those rows per currency, as `excluded_card_settlement_sums` returned it under the elected convention, never converted or added across currencies. `null` when the sum returned `null`."
      +    },
      +    "count": {
      +      "anyOf": [
      +        {
      +          "maximum": 9007199254740991,
      +          "minimum": 0,
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The sum's `excluded_card_settlement`. `null` when it could not be counted, never 0."
      +    }
      +  },
      +  "required": [
      +    "count",
      +    "amounts"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / excluded / properties / card_settlement
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "amounts": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "amount": {
      +                "type": "number"
      +              },
      +              "currency": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "currency",
      +              "amount"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "count": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "required": [
      +    "count",
      +    "amounts"
      +  ],
      +  "type": "object"
      +}
  3. 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."
  4. 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"
      +    }
      +  ]
      +}
  5. 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"
      +}
  6. 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"
      +}
  7. 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."
  8. 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"
      +}
  9. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark it read-only and non-destructive, but the description adds substantial behavior: the server derives no breakdown, shares are derived from amounts, the card draws ring/legend/month, all fields return in text, and many validation refusals are enumerated. It also clarifies the meaning of an empty entries array.

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?

The description is front-loaded and well structured with headers and bullets, which suits a complex 13-parameter tool. It is still lengthy and occasionally repetitive, especially around 'this tool measures nothing' and the long refusal list, so it falls short of maximum conciseness.

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?

Given the tool's complexity, strict validation, nested schema, and output schema, the description is complete enough: it explains what the card draws, what returns in the text result, how empty entries should be interpreted, and how workspace selection works. No critical caller context appears missing.

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 100%, so the baseline would be 3, but the description adds major semantic detail beyond schema: entries must be positive, descending, max four named slices plus Other; no pct field; period must be exactly one whole calendar month; rung and label_provenance have nuanced rules; excluded groups explain credit card spend, null versus zero, and containment relationships.

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 description states a specific action—putting a caller-computed cost breakdown onto the cost-structure card—and explicitly distinguishes it from measuring or fetching a cost structure. An agent can tell this is a rendering tool for already-computed slices, not a computation tool.

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 gives explicit when-to-use guidance: call only after computing the breakdown yourself, never to 'get' one. It also explains workspace selection: call directly when one workspace is authorized, pass workspace_id when several are.

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