Skip to main content
Glama

Skicka kundfaktura med e-post

send_customer_invoice
Destructive

Skickar en BOKFÖRD kundfaktura (eller kreditfaktura) som PDF med e-post till kunden. Avsändare är bolagets namn, och kundens svar går till bolagets e-post. Bekräfta alltid mottagarens adress och att fakturan ska skickas med användaren innan du anropar; ett mejl går inte att ta tillbaka. Adresser som studsat spärras, och det finns ett tak per dag. En faktura skickas bara när bolaget har betalningsuppgifter (bankgiro, plusgiro, bankkonto eller IBAN). Fakturan ändras inte av utskicket; PDF:en som skickades sparas på utskicket. Mottagaren sparas som kundens e-postadress bara med save_customer_email=true (fråga användaren). Med send_at schemaläggs utskicket i stället: ISO-tid, utan tidszon tolkas den som svensk tid (t.ex. 2026-12-01T08:00). Ligger fakturadatumet framåt i tiden, föreslå fakturadagen kl. 08.00 och bekräfta tiden med användaren. Ett nytt anrop med send_at flyttar utskicket, ett utan send_at skickar direkt och tar bort schemat. Svaret har scheduled_send_at (UTC). Misslyckas utskicket får användaren ett mejl och fakturan scheduled_send_error. Scope book. Argument: orgnr, invoice_id, to (e-postadress); valfritt message (text i mejlet), save_customer_email, send_at.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "orgnr": "<orgnr>",
      "invoice_id": "<invoice_id>",
      "to": "<to>"
    },
    "name": "send_customer_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYes
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
messageNo
send_atNo
invoice_idYes
save_customer_emailNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / send_at
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Send At"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / save_customer_email
      Added value: +{
      +  "default": false,
      +  "title": "Save Customer Email",
      +  "type": "boolean"
      +}
  3. Added

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the destructive/openWorld annotations it discloses that an email cannot be recalled, that bounced addresses are blocked, that there is a daily send cap, that the invoice itself is unchanged while the sent PDF is stored on the send, how future-dated invoices should be scheduled, and how failures surface (user email plus scheduled_send_error status).

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 irreversible-send warning and the booking prerequisite are front-loaded, and the scheduling paragraph is dense but purposeful. The trailing 'Argument:' enumeration partially repeats the schema, though it is defensible given the low description coverage.

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 destructive, open-world send with no output schema, the description covers prerequisites, confirmation duties, scheduling semantics, the response field scheduled_send_at in UTC, and failure behavior — everything an agent needs before calling.

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?

With only 17% schema coverage the description must carry the load, and it explains message (text in the email), save_customer_email (only then is the address stored), and send_at (ISO time, timezone-less values read as Swedish time, plus an example). invoice_id is only listed as an argument with no added meaning, which is the one gap.

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 states a specific verb and resource ('Skickar en BOKFÖRD kundfaktura ... som PDF med e-post') and narrows scope to booked invoices or credit invoices, which distinguishes it from book_customer_invoice and create_customer_invoice in the sibling list.

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 preconditions (invoice must be booked, company must have payment details), a mandatory confirmation step with the user, and a clear rule for choosing send_at versus immediate sending, including that a call without send_at removes an existing schedule. It also names the save_customer_email branch and says to ask the user first.

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.