Skip to main content
Glama

Queue invoice collection

well_enqueue_invoice_fetch
Idempotent

Queue invoice collection for named counterparties. This creates one durable backlog task per counterparty. The browser agent (a provider that carries a blueprint or a real portal URL) or the manual-upload route picks up each task later.

Call this tool only after the user explicitly confirms the launch. Never call it on your own initiative.

Get counterparty_company_ids from well_list_missing_invoices. This tool takes no period argument: a collection task belongs to a counterparty, not a month.

A repeat call for a counterparty that already has a non-terminal task reuses that task (already_active: true) instead of creating a second one.

provider.has_blueprint and provider.has_portal_url on an enqueued row state which counterparties a browser agent will visit (either one is enough), and which fall back to manual upload (neither).

Creating the tasks launches nothing in the browser. Inside Well the tasks page and the chat card start and track them. From outside Well, hand the user the collect_url from well_preview_invoice_fetch to start the runs. That link never covers every enqueued counterparty. One link names at most 25 portals, so a counterparty past that ceiling appears in well_preview_invoice_fetch's collect_url_omits instead of on the link. A counterparty with provider: null has no portal at all and is routed to manual upload. A counterparty with an address the link cannot carry appears in collect_url_unaddressable. Never tell the user the link covers a counterparty it does not name.

Use well_preview_invoice_fetch first to see what a fetch would cover — it is read-only and launches nothing. Use well_enqueue_close_invoice_fetch instead of this tool when you are inside a close run: it is the same action, scoped to that run's flow_run_id. Use this tool outside a close run.

Report the counts back to the user: how many tasks were enqueued, how many of those were already active, and how many counterparties were skipped, with each skip's reason.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say 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.
idempotency_keyNoOptional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation.
counterparty_company_idsYesCounterparty companies to queue collection for, from well_list_missing_invoices.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
skippedNo
successYes
enqueuedNo
skipped_countNo
enqueued_countNoRows in enqueued — created or reused.
refusal_reasonNoThe WellError code when the write is refused.
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
already_active_countNoOf enqueued_count, how many reused an existing task rather than creating one.
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. 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"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / enqueued / items / properties / provider / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "countries": {
      -        "items": {
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "has_blueprint": {
      -        "type": "boolean"
      -      },
      -      "id": {
      -        "format": "uuid",
      -        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -        "type": "string"
      -      },
      -      "logo_url": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "name": {
      -        "type": "string"
      -      },
      -      "slug": {
      -        "type": "string"
      -      },
      -      "url": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "name",
      -      "slug",
      -      "url",
      -      "logo_url",
      -      "countries",
      -      "has_blueprint"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "countries": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "has_blueprint": {
      +        "type": "boolean"
      +      },
      +      "has_portal_url": {
      +        "type": "boolean"
      +      },
      +      "id": {
      +        "format": "uuid",
      +        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +        "type": "string"
      +      },
      +      "logo_url": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "slug": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "name",
      +      "slug",
      +      "url",
      +      "logo_url",
      +      "countries",
      +      "has_blueprint",
      +      "has_portal_url"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed1 schema field changed
    • changedOutput schema / properties / skipped / items / properties / reason / enum
      Previous value: -[
      -  "company_not_found_in_workspace"
      -]New value: +[
      +  "company_not_found_in_workspace",
      +  "not_owned_by_current_user"
      +]
  4. Added

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses idempotent reuse via already_active, that no browser actions are launched synchronously, the 25-portal collect_url ceiling, provider: null fallback to manual upload, and omitted/unaddressable counterparty handling. These are behavioral traits an agent would not infer from the schema or annotations.

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

Conciseness5/5

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

The description is lengthy but every sentence carries necessary behavioral or routing information. It front-loads the core purpose and follows with usage constraints, then edge cases taxonomically (already active, portal ceiling, null provider, unaddressable). No filler or repetition is present.

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 and the presence of an output schema, the description covers everything an agent needs: safety gate, input source, idempotency, asynchronous behavior, inside/outside close-run routing, link limitations, manual-upload fallback, and required reporting to the user. 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 description coverage is 100%, so the baseline is already high. The description adds meaningful parameter guidance by naming the source of counterparty_company_ids (well_list_missing_invoices) and explicitly noting the tool takes no period argument, which prevents a common misuse. It does not add much beyond schema for workspace_id, conversation_id, or idempotency_key, but those are already well described in the schema.

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 opens with a specific verb and resource: 'Queue invoice collection for named counterparties,' and adds a precise mechanism: 'one durable backlog task per counterparty.' It clearly distinguishes this tool from the close-run variant, well_enqueue_close_invoice_fetch, and positions it against well_preview_invoice_fetch.

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?

The description states exactly when to invoke the tool ('only after the user explicitly confirms the launch'), never on own initiative, and where the input comes from ('Get counterparty_company_ids from well_list_missing_invoices'). It explicitly routes to well_preview_invoice_fetch for read-only preview and to well_enqueue_close_invoice_fetch inside a close run, leaving no ambiguity about alternatives.

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