Skip to main content
Glama

Create invoice template

well_create_invoice_template

Start building a reusable invoice template from one of the user's own invoices, a PDF already uploaded to this workspace.

Pass the document_id of that PDF. The build reads every page's text, fonts, colours, rules and boxes, marks which of them carry the invoice's data, and assembles a template that copies everything else from the page. It renders the template back and compares it against the original; a template that fails a check goes back for repair, and only one that passes every check is judged by a reviewer. The PDF may run over several pages of one size, at most 30, and must carry a real text layer: a scanned image fails the job with that reason.

This returns as soon as the job is queued; it does not wait for the template. Asking twice for the same PDF while a build runs returns the same job. A build that cannot finish within its time and cost limits stops without a template; offer the built-in designs instead. A build waits its turn when the service is busy, and one that never gets a turn before the queue's last delivery also ends without a template.

A finished template is NOT usable yet. It lands awaiting review, and only the user's own keep, after seeing it beside their invoice, makes it the workspace's design: call well_create_workspace_invoice_design only once the user said to keep it.

Input Schema

NameRequiredDescriptionDefault
document_idYesThe user's own invoice PDF the template is modelled on.
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.
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
successYes
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.
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.
enrichment_task_idNoThe queued job, for correlating its later result.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
reference_document_idNo
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. 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"
      +}
  3. 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"
      +}
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Well beyond the annotations, it discloses async semantics (returns on queue, does not wait), idempotent dedup ('asking twice for the same PDF while a build runs returns the same job'), several distinct failure modes (scanned image, time/cost limits, queue starvation), and the review-gating lifecycle where a finished template is 'NOT usable yet.' This is unusually rich behavioral context.

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?

Purpose and required parameter are front-loaded in the first two paragraphs, and the paragraphs cover distinct concerns (pipeline, async behavior, review gate). It is somewhat verbose and prose-heavy in places, but the length is largely justified by the complexity of the async/review workflow.

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 presence of an output schema and the async nature of the tool, the description covers everything an agent needs: inputs, preconditions, terminal states, failure handling, and the required follow-up call. Nothing material is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so all five parameters are already documented in the schema. The description reinforces document_id usage but adds no syntax or format detail beyond it, so the baseline 3 applies.

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 opening sentence gives a precise verb+resource+source: 'Start building a reusable invoice template from one of the user's own invoices, a PDF already uploaded to this workspace.' It is clearly distinguishable from siblings like well_create_invoice_template_revision and well_create_workspace_invoice_design, and the latter is explicitly named as a separate downstream step.

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 states the required input ('Pass the document_id of that PDF'), the precondition (PDF must have a real text layer, <=30 pages), the fallback when the build fails ('offer the built-in designs instead'), and routes the keep decision to well_create_workspace_invoice_design only after user confirmation. When/when-not/alternative guidance is all present.

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