Skip to main content
Glama

Create invoice from data

well_create_invoice_from_data

Create an invoice in Well from data you extracted by reading an invoice (your own OCR) — you send the structured fields, not the file.

Well persists the invoice + its line items + payment means using the same pipeline as uploaded documents. Fill every field you can read from the document:

  • issuer / receiver: { name (required), company_id?, domain?, tax_id? }

  • reference_number, issue_date (YYYY-MM-DD), due_date? (YYYY-MM-DD), currency (ISO 4217)

  • totals?: { items_total?, tax_total?, grand_total }

  • line_items[]: { name, quantity?, unit_price, currency?, tax_rate? }

  • payment_means?[]: { type, iban?, bic?, scheme? }

  • status?: draft | issued | paid | canceled

ONE CALL IS THE WHOLE WRITE. This tool takes the invoice's status and both parties' company ids, so a create never needs a well_update_invoice after it:

  • The user asked to DRAFT an invoice → pass status: "draft" here.

  • You already found the company (well_query_records, well_get_entity) → pass its company_id on that party. Naming the party without its id re-resolves it, which can attach the invoice to the wrong company or create a duplicate one.

Creating and then patching the same invoice writes twice and shows the user two confirmations for one action. Put the intent in this call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issuerYes
statusNoThe invoice's lifecycle status. Set it here when the user asked for one ("draft an invoice") — do NOT create and then call well_update_invoice to change it. Omitted, the status is derived from the document type.
totalsNo
currencyYesISO 4217 (3 letters).
due_dateNoISO 8601 YYYY-MM-DD.
receiverYes
issue_dateYesISO 8601 YYYY-MM-DD.
line_itemsYes
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.
payment_meansNo
idempotency_keyNoOptional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation.
reference_numberYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
successYes
invoice_idNo
document_idNo
payment_meansNo
reference_numberNo
invoice_item_countNo

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses important side effects: re-resolving a party without company_id 'can attach the invoice to the wrong company or create a duplicate one,' and creating then patching 'writes twice and shows the user two confirmations for one action.' This goes far beyond the annotation metadata.

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 long but efficiently organized: the core distinction is front-loaded, the field summary is compact, and the critical workflow warning is isolated under a bolded heading. A small amount of redundancy exists with the schema's own company_id description, but no sentence is wasted.

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 12-parameter, nested-object write tool, the description covers the full data shape, formats, the workflow around status and company_id, and the pitfalls of double-writing. An output schema exists, so return-value explanation is unnecessary, and the combination leaves no significant gap for an agent to call this tool correctly.

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 50%, and the description compensates with a compact field map including formats (YYYY-MM-DD, ISO 4217) and nested structures (issuer/receiver, totals, line_items, payment_means, status). It adds decision-level semantics—e.g., 'ALWAYS send this when you already know the company' for company_id and 'pass status:"draft" here' for status—meaning beyond the raw 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 states a specific verb and resource: 'Create an invoice in Well from data you extracted by reading an invoice' and distinguishes itself by clarifying 'you send the structured fields, not the file.' It also frames itself as the complete write, contrasting with well_update_invoice, which makes its role clear relative to siblings.

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 explicitly tells when to use this tool instead of alternatives: don't use well_create_invoice_document when you have structured fields rather than a file, and don't follow up with well_update_invoice because 'ONE CALL IS THE WHOLE WRITE.' It also gives concrete conditions like passing status:'draft' when the user asked for a draft and passing company_id when the company was already found via well_query_records or well_get_entity.

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.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: CRUD for companies, people, and invoices; financial analytics (cash, cost, runway, holdings); connector management and invocation; schema discovery; querying; reconciliation; and contact channel management. No two tools could be confused for the same action.

Naming Consistency5/5

All tools follow the `well_verb_noun` pattern with consistent verb choices (create, get, list, update, delete, add, remove, run, resolve, query, invoke). The naming is predictable and makes the tool's purpose immediately clear.

Tool Count4/5

With 26 tools, the set is slightly above the ideal 3-15 range, but every tool earns its place given the breadth of the domain (CRM, invoicing, financial analytics, reconciliation, connector management). The count is well-scoped and not excessive.

Completeness4/5

The tool surface covers core CRUD, financial KPIs, reconciliation, and connector management. Minor gaps exist (e.g., no direct tool to update contact channels or manage accounts), but the query and schema tools allow agents to work around them, and the primary workflows are fully supported.

Resources