adjust_stock
ChatGPTSet the counted stock of a product at a location (inventory adjustment), e.g. after a physical count or to load initial stock. The new quantity is ABSOLUTE — it replaces the current stock at that location, it does not add. MANDATORY two-step gate: first call WITHOUT confirm — it returns a preview (current → new quantity); show it to the user verbatim. Only after an explicit "sí"/"confirma" call again with the SAME arguments plus confirm=true. The quantity must be the user's counted number — never guessed or derived.
archive_customer
ChatGPTArchive a customer (baja lógica) — the ERP-correct way to "delete" one. The customer disappears from lists but ALL their invoices, quotes and history are preserved (fiscal records must be kept; a real delete is impossible for a customer with accounting entries). It is REVERSIBLE with unarchive_customer. MANDATORY two-step gate: first call WITHOUT confirm to get a preview; only after an explicit "sí"/"confirma" call again with the SAME arguments plus confirm=true.
archive_product
ChatGPTArchive a product/service (baja lógica) — the ERP-correct "delete". Disappears from the catalog and search but stays on existing quotes/invoices and history; REVERSIBLE with unarchive_product. Two-step gate: call without confirm for a preview, then with confirm=true only after an explicit "sí".
archive_supplier
ChatGPTArchive a supplier (baja lógica) — the ERP-correct "delete". Disappears from lists but all bills and history stay; REVERSIBLE with unarchive_supplier. Two-step gate: call without confirm for a preview, then with confirm=true only after an explicit "sí".
cancel_invoice
ChatGPTCancel a DRAFT invoice (it was never official, nothing to reverse). POSTED invoices cannot be cancelled — the engine rejects it; use create_credit_note instead (the accounting-correct annulment).
cancel_quote
ChatGPTCancel a quote that will not go ahead. Reversible in the sense that the record stays in history; a quote with a POSTED invoice is refused (that needs a credit note instead). Two-step: call without confirm for a preview, then with confirm=true after an explicit yes.
check_stock
ChatGPTCheck current stock. Pass product_id (from search_products) for one product's totals plus per-location breakdown; pass only location_id to see everything stored there; pass neither to list stock across all locations.
confirm_quote
ChatGPTConfirm a draft quote, turning it into a firm order ready to invoice.
connect_notifications
ChatGPTConnect the company's Telegram channel — where Anthill delivers proactive reminders and invoice-approval requests when automations fire (there is no chat open at that moment, so this is the only way to reach the user). Returns a one-time code: tell the user to open the Anthill bot in Telegram and send /start <code> to finish the binding.
create_automation
ChatGPTCreate an automation that Anthill runs BY ITSELF on a schedule, with no chat open — recurring ("recuérdame los días 14 que tengo que facturar a ACF") or ONE-OFF ("avísame mañana a las 10", "en 20 minutos": pass the cron of that exact moment plus once=true). Three actions are available: - notify: send the user a reminder message through the company's notification channel (Telegram). - draft_invoice: prepare an invoice PREVIEW for a customer and ask the user for approval through the notification channel. NOTHING is written to the ERP until the user approves each occurrence — this automation never auto-issues invoices. - agent_run: wake Anthill's own agent with a written goal; it reviews the company's data READ-ONLY (plus memories and reminders) and messages its findings through the notification channel. It can never create documents or move money by itself. action="notify" is created on the FIRST call (a reminder writes nothing when it fires): schedule it and tell the user IN YOUR OWN WORDS what you set up — no preview, no confirm step. draft_invoice and agent_run keep a MANDATORY two-step gate: first call WITHOUT confirm returns a preview to show the user verbatim; only after an explicit "sí"/"confirma" call again with the SAME arguments plus confirm=true. PRICING RULE: unit prices must come from the user, the catalog or existing documents — never invent or estimate them; if missing, ask first.
create_credit_note
ChatGPTCreate a CREDIT NOTE (nota de crédito) fully reversing a POSTED invoice — the accounting-correct way to annul it (same amounts, taxes and currency, opposite sign). If the invoice had no payments it is auto-reconciled and ends as 'reversed' with zero residual. MANDATORY two-step gate: first call WITHOUT confirm to get a preview; only after an explicit "sí"/"confirma" call again with the SAME arguments plus confirm=true.
create_customer
ChatGPTCreate a new customer. Only the name is required — add email, phone, business tax registration number and address when the user provides them.
create_invoice
ChatGPTIssue a customer invoice. Either derive it from a confirmed quote (pass quote_id, optionally with explicit lines for partial invoicing) or create it standalone from free-form lines. TAXES: by default each line gets the company's default tax (21% IVA in ES). For customers that must NOT carry Spanish VAT (exports, extra-EU clients), pass "tax_ids": [] on EVERY line — never leave default taxes on an export invoice. Ask the user when unsure; never guess the tax treatment.
create_product
ChatGPTAdd a new product or service to the company's catalog. Use this to load a catalog (e.g. from a list the user pasted or a spreadsheet) and BEFORE quoting something recurring, so the item exists once with a real price instead of being auto-created from a quote line. Only name and kind are required. NEVER invent commercial data: list_price and standard_price must come from the user or a document they provided — if you don't have a price, leave it out and ask. Always search_products first to avoid creating a duplicate.
create_quote
ChatGPTCreate a NEW quote (presupuesto) in the ERP. NEVER call this directly after gathering data — ALWAYS show preview_quote first and wait for the user's explicit confirmation ("sí", "dale", "confirma"). When the user confirms the preview, call this in that same turn. The server ENFORCES this: create_quote is rejected without a valid preview_id, and the lines + global_price must be exactly the ones the user saw in that preview. The quote is created in draft — confirm_quote makes it a firm order, only on explicit request. To correct an existing quote use update_quote — do NOT create a duplicate. PRICING RULE: never invent or estimate prices. A price must come from the user's message, the product catalog (search_products), or a previous quote. If a price is missing, ASK the user (one question per turn). Only suggest reference prices if the user explicitly asks you to, and present them as suggestions requiring their confirmation.
create_supplier
ChatGPTCreate a new supplier (vendor).
delete_automation
ChatGPTDelete an automation permanently. Confirm with the user first.
forget
ChatGPTArchive a memory that is wrong or obsolete. Get the memory_id from recall first, and confirm with the user which one to remove.
get_aging
ChatGPTOverdue money bucketed 30/60/90+ days, per customer or per supplier — "who owes me and how late". Use kind='payable' for what the company owes.
get_company_info
ChatGPTGet the company's profile in Anthill: name, country, ERP engine status, and the connections (e.g. email inbox) this company's agent can access.
get_customer_debt
ChatGPTGet how much a customer owes: open invoices and amounts due.
get_customer_statement
ChatGPTItemized customer account (cuenta corriente): invoices and payments in date order with a running balance. Use this when the user wants the detail behind a balance; get_customer_debt gives only the total.
get_delivery_note_pdf
ChatGPTGet a download link for a delivery note PDF (albarán), ready to print or share with the customer. Present it to the user as a clickable link.
get_document_branding
ChatGPTGet the current visual customization of the company's documents: cover & closing pages of quotes (presentation), the layout shared by quotes and invoices (colors, font, letterhead, footers), whether presentation mode is on, and the ALLOWED VALUES for every selection field (layout styles, textures, fonts, paper formats). Call this BEFORE update_document_branding to know the current state and the valid options.
get_email
ChatGPTRead one email from the active company's connected inbox: headers, text body (truncated if very long) and attachment filenames.
get_email_attachment
ChatGPTGet a download link for one attachment of an email in the active company's inbox (e.g. an invoice PDF someone sent). Returns a signed link; present it to the user.
get_financial_summary
ChatGPTIncome, expenses and result for a period, plus cash/bank balances — the "how is the business doing" answer. Defaults to the current year.
get_invoice_pdf
ChatGPTGet a download link for an invoice's PDF document, ready to share with the customer. Present it to the user as a clickable link.
get_quote
ChatGPTGet a quote's full detail: lines, totals, state and remaining amount to invoice.
get_quote_pdf
ChatGPTGet a download link for a quote's PDF document, ready to share with the customer. Present it to the user as a clickable link.
get_supplier_debt
ChatGPTWhat the company OWES one supplier: unpaid/partially paid bills and the outstanding total. The mirror of get_customer_debt.
get_vat_position
ChatGPTVAT charged minus VAT borne for a period → the indicative amount owed to the tax office. Defaults to the CURRENT QUARTER. ALWAYS present this as an orientation figure computed from posted entries, never as the official filing — the accountant files the real return.
list_automations
ChatGPTList the company's automations: schedule, action, status and next run.
list_customers
ChatGPTList the company's customers. Optionally filter by a free-text search over name, email, phone or tax ID.
list_my_companies
ChatGPTList every company this login can operate and which one is ACTIVE (every other tool acts on the active one). Call it when the user mentions another of their businesses, asks which company they are on, or a customer/document seems to belong to a different company.
list_pending_bills
ChatGPTEvery unpaid supplier bill, oldest due first, with the overdue subtotal — "what do I owe / what's overdue". The mirror of list_pending_invoices.
list_pending_deliveries
ChatGPTList pending delivery orders (albaranes de salida): what still has to be shipped or handed to customers, with items, quantities and addresses.
list_pending_invoices
ChatGPTList customer invoices that are unpaid or partially paid.
list_quotes
ChatGPTList quotes, optionally filtered by customer and/or state.
list_stock_locations
ChatGPTList the company's internal stock locations (warehouses and zones).
list_suppliers
ChatGPTList the company's suppliers (vendors).
list_taxes
ChatGPTList the tax rates this company can actually put on a line, with the id each one needs, plus the company's default tax. Call this BEFORE passing tax_ids anywhere (create_invoice lines, automations): tax ids are company-specific and must NEVER be guessed — a wrong id produces a legally wrong invoice. If the user just wants the normal rate, omit tax_ids entirely and the company default applies; only reach for an explicit id when they asked for a specific treatment (reduced rate, exempt, intra-EU).
pause_automation
ChatGPTPause an active automation (it stops firing) or resume a paused one.
post_invoice
ChatGPTPublish (post) a DRAFT invoice, making it official and sequenced. Only call when the user explicitly asks to post/publish it. Idempotent if already posted.
preview_branding
ChatGPTRender a PDF preview of the CURRENT branding so the user can see it: the quote cover page, the closing page, or a sample document with the shared layout (needs at least one quote to exist). Returns a download link; present it to the user.
preview_quote
ChatGPTRender a PREVIEW of a quote for the user to review BEFORE anything is created in the ERP. This step is MANDATORY before create_quote — even if the user gave customer, work and price in a single message. The response includes a preview_id that create_quote REQUIRES (the server rejects create_quote without it). Writes nothing in the ERP. If the user requests changes, re-emit the preview with the changes (each preview issues a fresh preview_id); only after an explicit "sí"/"confirma" call create_quote with the LATEST preview_id and the same lines. Draft the professional wording YOURSELF from the user's words (never ask for a title or for what to include/exclude — infer sensible defaults): rewrite each job as a complete customer-facing sentence, group by zones with section headers when the user organizes work that way, and list what is included / not included transparently.
recall
ChatGPTSearch the company's saved memories. Call this at the START of a task to recover context from previous conversations (any agent, any channel) — e.g. before drafting a quote for a known customer, recall that customer's name.
register_expense
ChatGPTRegister a purchase/expense: 'I bought N units of X at Y each from supplier Z'. Creates and completes the whole purchase flow, optionally generating the vendor bill.
register_misc_expense
ChatGPTRegister a miscellaneous expense that is NOT a supplier purchase or a supplier bill: taxes, bank fees, rent, small cash outflows. Creates a posted accounting entry immediately, so amount and description must come from the user — confirm both before calling if there is any ambiguity.
register_payment
ChatGPTRegister a payment received for a customer invoice. This writes an accounting entry in the company's own ERP — it never moves funds and never asks for card or bank account numbers (the optional reference/bank name are bookkeeping labels for the ledger entry).
register_vendor_bill
ChatGPTRegister a supplier invoice (factura de proveedor) the company RECEIVED, with its lines as they appear on the document. Use this when the user has a bill in hand — unlike register_expense it does not model a product purchase, it records the bill itself. The bill is posted but NOT marked as paid: only set mark_paid=true when the user explicitly says it is already paid. Amounts must come from the actual bill — never invented or estimated.
remember
ChatGPTSave a durable memory about the company that must survive this conversation: preferences ("invoices for ACF go in English"), recurring facts ("customer García always pays by check"), or standing instructions. Use it whenever the user states something worth keeping — memories are shared across every agent and channel connected to this company. Never store secrets (passwords, API keys) or commercial data that belongs in the ERP itself (prices go in the catalog, debts in invoices).
search_inbox
ChatGPTSearch the ACTIVE company's connected email inbox (read-only — this agent can never send email). Accepts raw Gmail query syntax: from:acme.com, subject:invoice, has:attachment, newer_than:7d, is:unread. Returns headers and snippets — use get_email for the full body and attachment names. switch_company also switches the mailbox.
search_products
ChatGPTSearch the company's products and services catalog (name, price, stock).
send_document_email
ChatGPTEmail a quote or a posted invoice to the customer, with its PDF attached. This LEAVES the building: it reaches the customer directly. Only call it when the user explicitly asked to send THIS document — never as a helpful extra step after creating one, and never to a recipient they did not give you. Confirm the destination address with them first if it isn't obvious.
switch_company
ChatGPTChange the ACTIVE company for this login — every subsequent tool call (quotes, invoices, payments, ...) runs against the selected company. Only switch when the user explicitly asks or confirms, and announce the switch in your reply. Previews created under the previous company become void — run preview_quote again after switching.
unarchive_customer
ChatGPTRestore a previously archived customer so it shows in lists again.
unarchive_product
ChatGPTRestore a previously archived product/service.
unarchive_supplier
ChatGPTRestore a previously archived supplier.
update_automation
ChatGPTModify an existing automation: schedule, title, reminder text or invoice lines. The action type cannot change (delete and recreate instead). Same rule as create_automation: a notify automation (reminder) is updated on the FIRST call — just tell the user what changed; draft_invoice and agent_run keep the two-step gate (call WITHOUT confirm first — it returns a preview of how the automation WILL look; only after the user's explicit "sí" call again with the SAME arguments plus confirm=true). Same pricing rule: never invent prices. Omitted fields keep their current value.
update_customer
ChatGPTEdit an existing customer's data. Pass ONLY the fields the user wants to change — everything else is left untouched. To CLEAR a field, pass an empty string "" for it (name cannot be cleared). Never invent data: only write values the user gave you.
update_document_branding
ChatGPTCustomize the look of the company's quotes and invoices. Changes are style-only (no business data) and apply immediately — after updating, call preview_branding and show the user the result so they can iterate. For selection fields use ONLY values listed by get_document_branding. NOTE: logo is GLOBAL (all documents and the company record) — mention it to the user when changing it. Presentation (cover/closing) only shows on quote PDFs when presentation_enabled is true.
update_product
ChatGPTEdit an existing product/service in the catalog. Pass ONLY the fields to change; pass "" to clear a text field (name cannot be cleared). Prices must come from the user — never invent them. Changing list_price here changes it for FUTURE quotes only (existing quotes keep their prices).
update_quote
ChatGPTModify an existing DRAFT quote in place: change line prices/quantities, add or remove lines, or update notes/validity. ALWAYS use this instead of creating a new quote when the user asks to correct or adjust an existing one — never duplicate quotes. Use get_quote first to obtain line IDs.
update_supplier
ChatGPTEdit an existing supplier's data. Pass ONLY the fields to change; pass "" to clear one (name cannot be cleared). Never invent data.
validate_delivery
ChatGPTMark a delivery order as DELIVERED (validar el albarán). Irreversible, and it completes ALL the order's lines as fully delivered — no partial deliveries. Only call when the user explicitly says that specific delivery went out / was handed over.