Files

Define a tag, type, field or correspondent

files_define · Changes data · Markdown

Adds, renames or deletes a tag, a document type, a custom field or a correspondent to file things with.

$0.001 a call

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

An example

Add a Total field for amounts in dollars, so we can file invoices by their total.

Your agent callsfiles_define$0.001 a call

The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.

With these arguments
{
  "kind": "field",
  "name": "Total",
  "field_type": "money",
  "currency": "USD"
}
What comes back
{
  "created": {
    "kind": "field",
    "name": "Total",
    "field_type": "money",
    "currency": "USD"
  }
}

Use it when

Files need a tag, type, field or correspondent that does not exist yet.

What it does

Add, rename or delete one of the account's own ways to file things: a tag, a document_type (Invoice, Contract, Receipt), a custom field (field_type: text, number, money, date, boolean (yes/no) or url; a money field has a default currency) or a correspondent (link it to a CRM company_id or contact_id). Matched by name, any case. Deleting takes it off every file (a field's values go with it). $0.001.

What comes back

What was defined (its kind, name, type, currency, CRM link) and created, or what was deleted. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
kindRequiredstringOne of: tag,document_type,field,correspondent.
nameRequiredstring1 to 200 characters.
new_namestringUp to 200 characters.
field_typestringOne of: text,number,money,date,boolean,url.
currencystring or nullA money field's currency for values given without one. Matches ^[A-Za-z]{3}$.
company_idinteger or nullAt least 1.
contact_idinteger or nullAt least 1.
deletebooleanDefault: false.

The call

Over MCP, call files_define on https://api.conecto.chat/mcp/files. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/files_define \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"field","name":"Total","field_type":"money","currency":"USD"}'

When it refuses

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

CodeWhenWhat to do
invalid_input400The name is empty or too long, or a new field has no field_type.Give a name, and a field_type for a new field.
name_taken409Something of that kind has that name already.Pick another name.
not_found404The CRM record or the thing to rename or delete does not exist.Check it with files_definitions.
type_fixed409Files have values for the field, so its type stays.Add a new field instead.
limit_reached409The business has as many of these as it may.Delete some with files_define.

Give this to your agent.

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