---
title: "Your first write tool: letting the AI open a support ticket | FluxOS MCP Blog"
description: "Reading is safe; creating and changing data takes care. How to enable the first write action on an MCP server: narrow arguments, confirmation, limits, and tests."
url: "https://www.fluxosmcp.com/en/blog/your-first-write-tool-letting-the-ai-open-a-support-ticket"
lang: "en-US"
---

[Blog](https://www.fluxosmcp.com/en/blog) · Nov 25, 2026 · FluxOS MCP Team

# Your first write tool: letting the AI open a support ticket

[Leia este artigo em português](https://www.fluxosmcp.com/blog/sua-primeira-ferramenta-de-escrita-deixando-a-ia-abrir-um-chamado)

Every tutorial on this blog so far has one thing in common: the tools only read. That is on purpose. A wrong query produces a wrong answer, which someone notices and corrects. A wrong write produces **wrong data**, which stays in the system.

But there comes a time when reading is not enough. The person asks the assistant about a problem, gets the answer, and says: “so open a ticket for me”. If the assistant cannot, the person goes back to the system and types it all over again.

This tutorial builds that first write action, with the precautions that set it apart from a query. The example is opening a support ticket, which is a good first case for three reasons: **it only creates, it changes nothing that already exists; it is easy to undo; and one extra ticket does not break anyone.**

## Before you start: choose the first one well

Not every write is a good debut. A good first write tool:

- **creates something new**, instead of changing or deleting what exists;
- **is simple to fix**: an unwanted ticket can be closed; an unwanted payment cannot;
- **tolerates repetition**: two identical tickets are annoying, but cause no damage;
- **has an owner**: someone will see what was created.

Opening a ticket, logging a contact, creating a reminder: good places to start. Changing a price, canceling an order, issuing a charge: leave those for later, when the team already trusts the mechanism.

## What you need

- A system of type **Banco SQL** (SQL database) connected in FluxOS MCP. The path is in [Ask your database in plain language](https://www.fluxosmcp.com/en/blog/ask-your-database-questions-in-plain-english-without-writing-sql).
- The basics of the canvas, from [From endpoint to workflow](https://www.fluxosmcp.com/en/blog/from-endpoint-to-workflow-a-tool-that-looks-up-decides-and-answers).
- A tickets table. The example uses this one:

```sql
chamados (id, empresa_id, titulo, descricao, prioridade, situacao, aberto_em)

```

`id`, `situacao`, and `aberto_em` are filled in by the database. `empresa_id` says which client the ticket belongs to.

If your ticketing system has an API instead of a database, the precautions are the same; only the block that does the write changes.

## Step 1: a database user that does only this

The connection you use for queries should be read-only, and should stay that way. For writes, create **another user**, with permission on the tickets table only:

```sql
CREATE ROLE assistente_chamados LOGIN PASSWORD 'troque-esta-senha';
GRANT USAGE ON SCHEMA sup TO assistente_chamados;
GRANT SELECT, INSERT ON sup.chamados TO assistente_chamados;
GRANT USAGE ON SEQUENCE sup.chamados_id_seq TO assistente_chamados;

```

No `UPDATE` and no `DELETE`. Even if someone, someday, publishes a tool that changes tickets by mistake, the database refuses. Register this user as a second connection and a second system, separate from the read one.

## Step 2: import only the insert tool

In the import, the `chamados` table shows up with five proposals: query, get by id, insert, update, and delete. The last three carry the **Escrita · destrutiva** (Write · destructive) label.

Select **only `inserir_chamados`**. It is tempting to select everything “to have it ready”. Don’t: every published write tool is a decision, and this is the only one you have made.

Choose `empresa_id` as the client filter. On an insert, this has an important effect: the column is **filled in by the server** with the identifier of the client that owns the key, and any value the assistant tries to provide is ignored. One client cannot open a ticket on behalf of another.

Create the tool on a server and open its **Canvas**.

## Step 3: narrow the arguments

This is the most important step in the tutorial.

The import proposes one argument for each writable column. In our example, that includes `id`, `situacao`, and `aberto_em`. In other words: as it came, the assistant could create a ticket whose status is already “fechado” (closed), or dated three months ago.

On a query, an extra argument is just noise. On a write, it is a door.

Open the **Chamado via MCP** (Called via MCP) trigger and replace the **Schema de entrada** (Input schema) with one that accepts only what a person actually provides:

```json
{
  "type": "object",
  "properties": {
    "titulo": {
      "type": "string",
      "description": "One-sentence summary of the problem, with no personal data.",
      "minLength": 5,
      "maxLength": 120
    },
    "descricao": {
      "type": "string",
      "description": "What happened, what the person expected, and what they have already tried.",
      "minLength": 20,
      "maxLength": 2000
    },
    "prioridade": {
      "type": "string",
      "description": "Use alta (high) only when the person's work is blocked.",
      "enum": ["baixa", "normal", "alta"]
    }
  },
  "required": ["titulo", "descricao"],
  "additionalProperties": false
}

```

What each part does:

- **Only three arguments.** `id`, `situacao`, and `aberto_em` are gone: the database fills them in.
- **`additionalProperties: false`.** Any field outside the list gets the call rejected before the workflow runs.
- **`enum` on the priority.** The assistant cannot make up “super urgent”. The values `baixa`, `normal`, and `alta` mean low, normal, and high.
- **Minimum and maximum lengths.** A ticket titled “error” with an empty description helps no one, and neither does a fifty-thousand-character text.

The server checks every call against this schema. It is the first safeguard, and the cheapest.

## Step 4: the description asks for confirmation

Rewrite the trigger’s **Descrição** (Description):

> Opens a support ticket on behalf of the company. Use only after the person has explicitly asked to open the ticket and has confirmed the title and the description. Do not use it to look up tickets. Each call creates a new ticket: do not repeat it if there is already a ticket number in the conversation.

The description says three things a query would not need to say: **only on explicit request**, **only after confirming**, and **do not repeat**.

It is worth being frank about how far this goes: the description is an instruction to the assistant, not a safeguard. Good assistants follow it, and there is some extra help: every write tool is announced as **destructive**, and assistant apps usually ask the person for confirmation before running it. But what really enforces the limit is steps 3, 6, and 7.

## Step 5: return a receipt, not the record

The imported tool returns the entire result of the write. For a write, the best response is a **short receipt** that the assistant can pass along and that makes it clear the action happened.

Between the write and **Responder ao MCP** (Respond to MCP), place an **Editar campos** (Edit fields) block, with **Manter somente os campos definidos** (Keep only the defined fields):

- `chamado`: `{{ $json.row.id }}`
- `situacao`: `{{ $json.row.situacao }}`
- `mensagem`: `Ticket {{ $json.row.id }} opened. Keep this number.`

The ticket number in the conversation serves a second purpose: it is what the description in step 4 relies on to avoid repetition.

## Step 6: one attempt only

Open the write block, go to the **Configurações** (Settings) tab, and check the **Tentativas** (Attempts) field: it should be set to **1**, which is the default.

On a query, retrying after a failure is great. On a write, it is dangerous: if the write happened but the response was lost, the second attempt creates a second ticket. FluxOS MCP does not currently have automatic protection against duplicate calls, so the rule is simple: **on a block that writes, one attempt.**

The same caution applies to the **Execuções** (Executions) screen: rerunning from the start an execution that has already written repeats the write.

## Step 7: a key just for this, with a low limit

Publish the workflow and the server. When it is time to hand over access:

- **Low daily limit.** How many tickets does a company open on a normal day? Ten? Set twenty. If an assistant gets stuck in a loop, the damage has a ceiling.
- **Low per-minute limit.** Two or three is enough.
- **Selected tools.** When creating the key, under **Ferramentas permitidas** (Allowed tools), choose **Somente as selecionadas** (Only the selected ones). The list marks write tools with the **Destrutiva** (Destructive) label. Not every key needs to see `inserir_chamados`.

A good practice is to have different keys for reading and for writing. That way you can revoke writes without taking queries away from anyone.

## Step 8: test what should not work

Run the first test on the canvas, with **Executar teste** (Run test). The others have to go through the published server, with a test key and a real assistant: it is the server that checks the arguments against the schema and applies the limits, and the canvas test does not go through those safeguards.

- **The happy path.** Valid title and description. The ticket shows up in the table, with the right company, status “aberto” (open), and the current date.
- **A forbidden field.** Send `"situacao": "fechado"` along with it. The call should be rejected with “Argumentos inválidos” (Invalid arguments).
- **A made-up priority.** `"prioridade": "urgente"` should be rejected.
- **A title that is too short.** Rejected.
- **Another client.** Open a ticket as client A and check, in the table, that `empresa_id` is A’s. Repeat as B.
- **The limit.** With a test key and a limit of two per minute, ask for three tickets in a row. The third should be rejected, with the wait time.

The tool is only ready when all six behave as described, and above all when the rejections happen.

## What the conversation looks like

> **Person:** the sales report hasn’t opened since yesterday, it gives a permission error.
>
> **Assistant:** I can open a ticket with support. I suggest the title “Sales report returns a permission error” and the description “Since yesterday the sales report does not open and shows a permission error. No access change was requested.” Normal priority. Confirm?
>
> **Person:** confirmed, but make it high priority, closing is today.
>
> **Assistant:** ticket 4812 opened, with high priority. Keep that number to follow up.

The assistant proposed, the person adjusted and confirmed, and the action happened once.

## The first week

Writes call for closer monitoring than reads. In the first few days:

- **Open the tool’s executions** and read the arguments. Do the titles make sense? Are there repeated tickets? The article [How to read an execution](https://www.fluxosmcp.com/en/blog/what-did-the-ai-do-yesterday-at-3-pm-how-to-read-an-execution-in-fluxos-mcp) shows where to look.
- **Ask whoever receives the tickets.** Did the quality get better or worse compared with the ones opened by hand?
- **Look at usage.** Requests rejected by limits point to a limit that is too low or an assistant that keeps insisting.

## And after that: updating and deleting

Once creation is stable, the next writes call for one more level of care:

- **Updating** requires identifying the record. Imported update tools ask for the `id` and the list of values to change, and they reject a change with no identification. Narrow the allowed values the same way as in step 3: if the tool is for changing the priority, the schema accepts only priority.
- **Deleting** should almost never be a tool. Prefer a status change, such as “canceled”, which leaves a trail and can be reversed.
- **Value rules** go in as decision blocks before the write, as in [Business rules without code](https://www.fluxosmcp.com/en/blog/no-code-business-rules-what-the-ai-can-and-cannot-do).

## Summary

A safe write tool does not depend on the assistant behaving. It depends on six things that are on your side:

1. a database user that does only that;
2. a schema that accepts only the necessary fields;
3. the client set by the key, never by an argument;
4. one attempt only;
5. a key with a low limit and selected tools;
6. tests of what should be rejected.

With that in place, “open a ticket for me” stops being a risk and becomes just one more thing the assistant handles. Before you open it up to clients, go through the [production checklist](https://www.fluxosmcp.com/en/blog/checklist-is-your-mcp-server-ready-for-production).
