Skip to main content
Glama

Create invoice upload url

create_invoice_upload_url

Step 1 of adding an invoice: creates a document row and returns a short-lived signed URL to PUT the PDF to. Upload the file yourself to that URL, then call book_invoice with the returned document_id. Returns { document_id, upload_url, storage_path, expires_in_seconds }. Pass document_id to attach or REPLACE the PDF of a document that already exists instead of creating a new one — that is how you fix an invoice that was booked without its file, and how you supply the PDF an already-pushed voucher is missing (then run sevdesk_attach_document). Pass source_url INSTEAD of uploading yourself and the server fetches the file in this one call — no upload_url comes back because there is nothing left to do. Use it for a signed download link from another system: those expire in minutes (a SynapseLingo invoice link lasts 600 seconds), and between two agent steps far more than that can pass, so a two-step upload loses the race and has to re-fetch. CONTRACTS (Mietvertrag, Darlehens-/Gesellschaftervertrag, Dauerrechnung): pass document_type:'contract' and optionally contract with the terms. A contract is filed as a Dauerbeleg for recurring bookings — it is never booked itself and never pushed to sevDesk, so skip book_invoice for it. list_contracts shows what is filed.

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": {
      "file_name": "<file_name>"
    },
    "name": "create_invoice_upload_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
contractNoOnly with document_type 'contract' (new or existing document): the terms, stored in metadata.contract and merged into what is there. Fields: nummer (contract number), beginn / ende (YYYY-MM-DD; omit ende or null for unbefristet), betrag (gross amount per period), turnus (monatlich | vierteljaehrlich | halbjaehrlich | jaehrlich | einmalig), kuendigungsfrist (text, e.g. '3 Monate zum Quartalsende'), notiz, belege (array of sevDesk voucher ids booked under this contract).
file_nameYesFile name including extension, e.g. 'rechnung-2026-04.pdf'
source_urlNohttp(s) URL the server should fetch the file from, in this same call. The response then reports fetched_bytes and content_type instead of an upload_url. Max 25 MB. Private and loopback addresses are refused — this fetch runs inside the server's own network.
document_idNoAttach the PDF to this existing document instead of creating a new row. The row's file_path and file_name are repointed at the new upload; nothing else about it changes.
vendor_nameNoSupplier name, if you already know it
document_typeNoinvoice (default) | receipt | contract | offer | order | other. 'contract' files a Vertrag (lease, loan, shareholder agreement) as Dauerbeleg; it is excluded from every sevDesk push.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations it discloses the side effect (a document row is created; with document_id the file_path/file_name are repointed and nothing else changes), the short-lived nature of the URL via expires_in_seconds, and that contracts are filed as Dauerbeleg and excluded from every sevDesk push. It does not cover auth/permission requirements, and the outbound http(s) fetch sits in some tension with openWorldHint=false, though the schema's refusal of private/loopback addresses mitigates that.

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 core contract (create row, upload yourself, call book_invoice with document_id, return shape) is front-loaded before the branch cases. It is dense and long for a tool description, and the contract/Dauerbeleg rule is restated in both the description and the schema, but almost every sentence carries decision-relevant information.

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?

With no output schema, the description explicitly declares the return payload ({ document_id, upload_url, storage_path, expires_in_seconds }) and the alternate return when source_url is used. For a 6-parameter nested tool with mutation side effects, the downstream-step chain (book_invoice, sevdesk_attach_document, list_contracts) is fully closed out.

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 3, but the description adds real semantics the schema does not: source_url yields no upload_url (only fetched_bytes/content_type), document_id REPLACES an existing PDF rather than creating a row, and contract/document_type pair together to route a filing as Dauerbeleg.

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 specific verb and resource ('creates a document row and returns a short-lived signed URL to PUT the PDF to') and positions it as step 1 of a named workflow. It also distinguishes itself from book_invoice, sevdesk_attach_document and list_contracts by name, so an agent can pick it without opening a sibling schema.

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 explicit when-to-use branches and mutually exclusive alternatives: pass document_id to replace an existing PDF, pass source_url instead of uploading yourself, pass document_type:'contract' for Vertraege and then skip book_invoice. It even names the failure mode (a two-step upload losing a 600-second signed link) that selects the source_url path.

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