Tools
The server exposes 17 tools grouped by functional area.Organization
get_user_organization_info
Returns the active organization context (tax ID, fiscal regime, and defaults) so the agent can operate with the correct fiscal context when company or tax defaults are needed.
get_mcp_workflows_guidance
Returns summarized MCP workflow guidance (workflow name, description, and kickoff steps) to help the agent plan or execute multistep flows.
Contacts
list_contacts
Search contacts in the organization with optional filters.
resolve_contact
Deterministically resolve a single contact. Returns status (unique / ambiguous / none) and up to 5 candidates. Use this before any write operation that requires a contact_id.
At least one of the four fields is required.
create_contact
Create a new contact in the organization. Idempotent on document_number: if a contact with that NIF/CIF already exists, returns the existing one instead of creating a duplicate.
update_contact
Update the fields of an existing contact. Only the fields passed are modified (PATCH semantics).
Products
resolve_product
Deterministically resolve a single product. Returns status (unique / ambiguous / none) and candidates. Use this before creating an invoice draft.
At least one of the two fields is required.
create_product
Add a new product to the organization’s catalogue.
update_product
Update the fields of an existing product. Only the fields passed are modified (PATCH semantics).
Invoices
resolve_invoice
Locate an existing issued invoice.
create_invoice_draft
Create an ordinary (F1) invoice draft. The draft is not issued; use issue_invoice_draft to make it fiscally binding.
Returns the draft_id, a confirmation_token, and a preview to show the user before issuing.
create_simplified_invoice_draft
Create a simplified (F2) invoice draft, without an associated contact. Useful for tickets or general public sales.
Returns draft_id, confirmation_token, and a preview.
issue_invoice_draft
Issue a draft (F1 or F2), making it fiscally binding. The invoice is automatically submitted to VeriFactu.
send_invoice_email
Send or resend an issued invoice by email to its associated contact.
Received invoices
create_received_invoice
Register a supplier invoice. Before calling it, use resolve_contact and show the user the supplier, number, date, lines, totals, payment state, accounting classification, and attachment state. Require explicit confirmation and a new UUID in idempotency_key.
The server calculates authoritative totals, detects duplicates, and rejects closed periods. control_totals lets you compare source-document totals with server-calculated totals; the response includes discrepancies.
The response returns the persisted id, authoritative totals, discrepancies, attachment state, and edit URL.
create_received_invoice_upload_session
Create a short-lived session for optionally attaching the invoice PDF or image. Use the returned upload_url or render the MCP App resource in ui.resourceUri. It accepts one server-validated document; do not send file bytes, storage keys, or credentials as arguments. Then pass upload_session_id to create_received_invoice.
update_received_invoice
Correct an existing received invoice after showing and confirming the complete corrected state. Use received_invoice_id and a new UUID in idempotency_key; if the supplier changes, resolve it first with resolve_contact. Omitted scalar fields are preserved and supplied lines replace the complete line set. attachment_action can be preserve, replace, or remove; upload_session_id is required when replacing. The response includes changed_fields, recalculated totals, and final attachment state.

