Skip to main content
Glama

List unmatched invoices per period

well_list_period_unmatched_invoices
Read-only

Count the invoices marked paid that have no confirmed bank payment, per fiscal period. This is the bank-to-books matching gap of a month. It draws no card and needs no close run.

Read one period with fiscal_year and fiscal_period (take them from a well_list_periods entry, or from the month the user already chose; never derive them from a calendar month yourself). Or read the most recent calendar months with months (the running month is included, so 12 complete months need 13).

Each period returns month (YYYY-MM), period_state (closed or open in Well), period_ended (false for the running month), unmatched_count, and sample_invoice_ids (at most 5 ids). unmatched_count is the full count; the sample is only a part of it when the count is above 5. To show the invoices (date, counterparty, amount), read those ids with well_query_records or well_show_records.

The paired write is well_retry_period_matching: it asks the matcher to look again at the period's unmatched invoices, up to 20 from a bounded query, not the sample ids.

success: false means the periods are UNKNOWN, not matched. The read failed, so no count exists. Never say the bank and the books match on a failed read.

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
monthsNoRead the N most recent calendar months instead of one period, the running month included (max 13, so 12 complete months need 13). Do not send it with fiscal_year or fiscal_period.
fiscal_yearNoThe fiscal year of the one period to read.
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.
fiscal_periodNoThe fiscal period (month 1-12) of the one period to read. Send it with fiscal_year.
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
errorNo
periodsYes
successYes
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.
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. Changed2 schema fields changed
    • 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. 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."
  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. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/destructiveHint, but the description adds substantial context beyond them: it discloses the 5-id sample cap, that period_ended is false for the running month, and critically that `success: false` means periods are UNKNOWN rather than matched — a real failure-mode warning an agent would otherwise misinterpret. It also notes no card is drawn and no close run is required.

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?

It is front-loaded with the definition, then parameter routing, then return shape, then the paired write and failure-mode warning — a logical order with no filler. It runs long and restates some return fields already covered by the output schema, which keeps it just short of a 5.

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 6-parameter read with an output schema, the description covers everything an agent needs: how to pick parameters, what each return field means, how to expand sample ids, the paired remediation tool, and how to interpret a failed read. No decision-relevant information 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 genuine meaning: the mutual exclusivity of months vs fiscal_year/fiscal_period with a concrete off-by-one example (12 complete months need 13), and the sourcing rule for fiscal_year/fiscal_period. The workspace_id and conversation_id behaviors are also explained in behavioral terms rather than just repeating field docs.

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 names a specific metric — invoices marked paid with no confirmed bank payment, counted per fiscal period — and frames it as the bank-to-books matching gap, which separates it from neighbors like well_sum_missing_invoices and well_list_missing_invoices. It also states what it does not need (no card, no close run), further pinning down its role.

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 routing: read one period via fiscal_year + fiscal_period (sourced from a well_list_periods entry, never derived from a calendar month) or use months for recent months. It names the paired write well_retry_period_matching and explains exactly how it differs (up to 20 from a bounded query, not the sample ids), and it states the workspace_id condition for multi-workspace tokens.

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