Documents

Fill a Word template

documents_fill_template · Changes data · Markdown

Makes a new Word file from a .docx template, its placeholders filled from data.

$0.02 a call

From your agent’s balance. A call that fails costs nothing.

An example

Fill in the delivery note template for Café Lotte's espresso machine, delivered on Friday.

Your agent callsdocuments_fill_template$0.02 a call

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "file_id": "6c8e0a2b-4d6f-4b8a-9c0e-1f3a5c7e9b2d",
  "name": "Delivery note Café Lotte.docx",
  "data": {
    "customer_name": "Café Lotte",
    "address": "Eppendorfer Weg 120, 20259 Hamburg",
    "delivery_date": "Friday, October 23",
    "items": [
      {
        "name": "Espresso machine, 2 groups",
        "quantity": 1
      }
    ]
  }
}
What comes back
{
  "file": {
    "file_id": "262c83f1-e073-4381-b79a-cd6e6a4383eb",
    "name": "Delivery note Café Lotte.docx",
    "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    "size": "35.9 KB",
    "size_bytes": 36723,
    "sha256": "ee834ae38089ef77623566aa7976b872d06b70882a454c9b10520a77360a3030",
    "created_at": "2026-10-14T08:00:00+00:00",
    "download_url": "https://cncto.co/d/262c83f1-e073-4381-b79a-cd6e6a4383eb?t=eyJmIjoiMjYyYzgzZjEtZTA3My00MzgxLWI3OWEtY2Q2ZTZhNDM4M2ViIiwiZXhwIjoxNzkyMTYxNjAzfQ:1xHMcl:KX7LuueC9lDjkylkG_jMv0fVDNC8gV1OaofPoKekjEk",
    "link_expires_in_hours": 24
  }
}

Use it when

The same document is made again and again with different details: delivery notes, contracts.

What it does

A new Word file from a .docx template in the store, its {{ placeholders }} filled from data. Templates use Jinja: {{ name }}, {% if paid %}...{% endif %}, and {%tr for row in rows %} to repeat a table row. Turn the result into a PDF with documents_convert_to_pdf.

What comes back

file: the filled Word file with its file_id, name, size and download link. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
file_idRequiredstringA file in the store (files_upload or files_list give its file_id). Exactly 36 characters.
dataRequiredobjectThe values, e.g. {"customer": "Acme", "items": [{"name": "Combi steamer", "price": "€9,800"}]}.
namestringName for the new file, e.g. "Quote 1042.pdf". 1 to 200 characters.
link_hoursinteger1 to 168. Default: 24.

The call

Over MCP, call documents_fill_template on https://api.conecto.chat/mcp/documents. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/documents_fill_template \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id":"6c8e0a2b-4d6f-4b8a-9c0e-1f3a5c7e9b2d","name":"Delivery note Café Lotte.docx","data":{"customer_name":"Café Lotte","address":"Eppendorfer Weg 120, 20259 Hamburg","delivery_date":"Friday, October 23","items":[{"name":"Espresso machine, 2 groups","quantity":1}]}}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
not_found404No file in the store has that file_id.Find it with files_list, or upload it first.
unsupported_type400The file is not a Word .docx file.Use a .docx template.
template_error422The template could not be filled; the message says where.Fix the template or give the data it asks for.
template_too_slow422Filling took too long.Simplify the template's loops.
storage_full409The file store has no room for the new file.Delete files with files_delete, or add room with files_add_storage.
too_large413The result would be over 25 MB.Make it smaller, or split it.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md