@lionchat/mcp-server 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +56 -2
- package/dist/tools.js +30 -4
- package/dist/tools.js.map +1 -1
- package/dist/utils.js +71 -3
- package/dist/utils.js.map +1 -1
- package/endpoints.json +157 -86
- package/package.json +3 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0 — 2026-05-05
|
|
4
|
+
|
|
5
|
+
### Adicionado
|
|
6
|
+
- Multi-conta: parametro `account_id` opcional em todas as tools sobrepoe `LIONCHAT_ACCOUNT_ID`
|
|
7
|
+
- Captain Assistants: 18 campos novos no create/update (temperature, instructions, follow_up_*, disabled_tools, offer_ids, media_asset_ids, booking_event_type_ids, etc)
|
|
8
|
+
- Captain Scenarios: campos `description` (obrigatorio) e `enabled`
|
|
9
|
+
- Captain FAQs: campo `assistant_id` (obrigatorio) e `status`
|
|
10
|
+
- Reports: parametros `type`, `id`, `business_hours`, `timezone_offset` documentados
|
|
11
|
+
- 2 endpoints novos: `captain/assistants/tools` (GET) e `captain/assistants/{id}/playground` (POST)
|
|
12
|
+
|
|
13
|
+
### Corrigido
|
|
14
|
+
- separateParams agora suporta nested params via dot-notation (config.temperature, config.feature_faq, etc) — antes campos eram silenciosamente descartados pelo strong_params do Rails
|
|
15
|
+
- Typo: `instructions` (plural) → `instruction` (singular) nos schemas de scenarios
|
|
16
|
+
|
|
17
|
+
### Notas
|
|
18
|
+
- Funciona contra LionChat backend a partir de 2026-05-05 (depende de fix backend pra reports/summary 500 e captain/assistants/create 500)
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @lionchat/mcp-server
|
|
2
2
|
|
|
3
|
-
MCP server que conecta agentes de IA a plataforma LionChat. Expoe mais de
|
|
3
|
+
MCP server que conecta agentes de IA a plataforma LionChat. Expoe mais de 547 ferramentas para gerenciar contatos, conversas, kanban, funis, mensagens, automacoes e muito mais.
|
|
4
|
+
|
|
5
|
+
> **v0.2.0** — Multi-conta via `account_id` opcional, 18 campos novos no AI Agente (Captain), playground e tools list, FAQs com assistant_id, reports com filtros completos. Veja `CHANGELOG.md`.
|
|
4
6
|
|
|
5
7
|
## O que e MCP?
|
|
6
8
|
|
|
@@ -69,6 +71,19 @@ npx @lionchat/mcp-server
|
|
|
69
71
|
|
|
70
72
|
---
|
|
71
73
|
|
|
74
|
+
## Trabalhando com multiplas contas
|
|
75
|
+
|
|
76
|
+
Toda ferramenta aceita um parametro opcional `account_id` que **sobrepoe** a variavel `LIONCHAT_ACCOUNT_ID` da sessao atual. Util para agentes que precisam consultar/operar em mais de uma conta sem reiniciar o MCP.
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
"Lista contatos da conta padrao": lionchat_contacts_list
|
|
80
|
+
"Lista contatos da conta 42": lionchat_contacts_list(account_id="42")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Se `account_id` nao for informado, o MCP usa o valor de `LIONCHAT_ACCOUNT_ID` (ou `--account=`). O token (`LIONCHAT_API_TOKEN`) precisa ter acesso a todas as contas que voce quer chamar.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
72
87
|
## Filtro por Categoria
|
|
73
88
|
|
|
74
89
|
Para melhor performance do agente, carregue apenas as ferramentas que precisa:
|
|
@@ -84,7 +99,7 @@ npx @lionchat/mcp-server --categories=contacts,conversations,kanban_items
|
|
|
84
99
|
| **Vendas** | `contacts,conversations,messages,kanban_items,funnels,offers` | CRM e automacao de vendas |
|
|
85
100
|
| **Suporte** | `contacts,conversations,messages,canned_responses,teams,labels` | Atendimento ao cliente |
|
|
86
101
|
| **Marketing** | `contacts,automation_rules,labels,scheduled_messages` | Campanhas e automacao |
|
|
87
|
-
| **Completo** | _(sem filtro)_ | Cobertura total da API (
|
|
102
|
+
| **Completo** | _(sem filtro)_ | Cobertura total da API (547 ferramentas) |
|
|
88
103
|
|
|
89
104
|
### Categorias Disponiveis
|
|
90
105
|
|
|
@@ -268,8 +283,47 @@ O MCP transforma o LionChat em uma plataforma controlavel por IA. Em vez de clic
|
|
|
268
283
|
"Resume a conversa 456 em 3 pontos principais"
|
|
269
284
|
|
|
270
285
|
"Adiciona a URL https://empresa.com/faq na base de conhecimento do assistente"
|
|
286
|
+
|
|
287
|
+
"Cria um AI Agente 'Closer' com modelo gpt-4o, temperatura 0.4,
|
|
288
|
+
ativa FAQ e citation, follow-up depois de 30 minutos"
|
|
271
289
|
```
|
|
272
290
|
|
|
291
|
+
#### Criar/Atualizar AI Agente — campos disponiveis (v0.2.0)
|
|
292
|
+
|
|
293
|
+
`lionchat_captain_assistants_create` e `_update` agora suportam dot-notation para campos aninhados em `config`. Exemplos:
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"name": "Closer Black Friday",
|
|
298
|
+
"description": "Agente de fechamento de vendas",
|
|
299
|
+
"response_guidelines": ["Seja direto", "Use prova social"],
|
|
300
|
+
"guardrails": ["Nao prometa desconto sem aprovacao"],
|
|
301
|
+
"config.model": "gpt-4o",
|
|
302
|
+
"config.temperature": 0.4,
|
|
303
|
+
"config.instructions": "Voce e um closer especialista...",
|
|
304
|
+
"config.feature_faq": true,
|
|
305
|
+
"config.feature_memory": true,
|
|
306
|
+
"config.feature_citation": true,
|
|
307
|
+
"config.welcome_message": "Oi! Vi que voce tem interesse...",
|
|
308
|
+
"config.min_response_time": 5,
|
|
309
|
+
"config.max_response_time": 15,
|
|
310
|
+
"config.feature_follow_up": true,
|
|
311
|
+
"config.follow_up_time": 30,
|
|
312
|
+
"config.follow_up_prompt": "Pergunte se ainda tem duvida.",
|
|
313
|
+
"config.disabled_tools": ["create_kanban_item"],
|
|
314
|
+
"config.offer_ids": [12, 17],
|
|
315
|
+
"config.media_asset_ids": [3],
|
|
316
|
+
"config.booking_event_type_ids": [5]
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Tambem novos:
|
|
321
|
+
|
|
322
|
+
| Ferramenta | Para que serve |
|
|
323
|
+
|------------|---------------|
|
|
324
|
+
| `lionchat_captain_assistants_tools` | Lista tools nativas/custom (com flag enabled/disabled por agente) |
|
|
325
|
+
| `lionchat_captain_assistants_playground` | Testa o agente sem criar conversa real |
|
|
326
|
+
|
|
273
327
|
### VoIP e Ligacoes
|
|
274
328
|
|
|
275
329
|
```
|
package/dist/tools.js
CHANGED
|
@@ -134,16 +134,33 @@ function paramTypeToZod(param) {
|
|
|
134
134
|
}
|
|
135
135
|
return schema;
|
|
136
136
|
}
|
|
137
|
-
// AIDEV-NOTE: Build Zod object schema from endpoint params
|
|
137
|
+
// AIDEV-NOTE: Build Zod object schema from endpoint params.
|
|
138
|
+
// account_id is exposed as OPTIONAL — when omitted we fall back to LIONCHAT_ACCOUNT_ID.
|
|
139
|
+
// This enables multi-tenant usage (single MCP instance can hit several accounts).
|
|
138
140
|
function buildZodSchema(params) {
|
|
139
141
|
const shape = {};
|
|
142
|
+
let hasAccountIdInPath = false;
|
|
140
143
|
for (const param of params) {
|
|
141
|
-
// AIDEV-NOTE: account_id is auto-injected from config, never exposed to MCP client
|
|
142
144
|
if (param.name === 'account_id') {
|
|
145
|
+
hasAccountIdInPath = true;
|
|
146
|
+
// AIDEV-NOTE: Force account_id optional regardless of how it was declared upstream.
|
|
147
|
+
// Tool handler resolves the effective value (input || config.accountId).
|
|
148
|
+
shape[param.name] = z
|
|
149
|
+
.string()
|
|
150
|
+
.optional()
|
|
151
|
+
.describe('ID da conta. Opcional — se ausente, usa LIONCHAT_ACCOUNT_ID. Informe para chamar uma conta diferente sem reiniciar o MCP.');
|
|
143
152
|
continue;
|
|
144
153
|
}
|
|
145
154
|
shape[param.name] = paramTypeToZod(param);
|
|
146
155
|
}
|
|
156
|
+
// AIDEV-NOTE: Some endpoints embed {account_id} in the path but do NOT declare it as a param.
|
|
157
|
+
// Expose it as optional so callers can override the env even on those tools.
|
|
158
|
+
if (!hasAccountIdInPath) {
|
|
159
|
+
shape['account_id'] = z
|
|
160
|
+
.string()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe('ID da conta. Opcional — se ausente, usa LIONCHAT_ACCOUNT_ID. Informe para chamar uma conta diferente sem reiniciar o MCP.');
|
|
163
|
+
}
|
|
147
164
|
return z.object(shape);
|
|
148
165
|
}
|
|
149
166
|
// AIDEV-NOTE: Check if endpoint has any file-type params (unsupported in MCP v1)
|
|
@@ -181,8 +198,17 @@ function registerSingleTool(server, config, client, endpoint) {
|
|
|
181
198
|
}
|
|
182
199
|
}
|
|
183
200
|
}
|
|
184
|
-
|
|
185
|
-
|
|
201
|
+
// AIDEV-NOTE: Multi-tenant — input account_id (if provided) overrides env LIONCHAT_ACCOUNT_ID.
|
|
202
|
+
// Resolve and strip account_id BEFORE bucketing so it never lands in body/query for
|
|
203
|
+
// endpoints that don't declare it as an explicit param.
|
|
204
|
+
const rawAccountId = params['account_id'];
|
|
205
|
+
const effectiveAccountId = rawAccountId !== undefined && rawAccountId !== null && String(rawAccountId).length > 0
|
|
206
|
+
? String(rawAccountId)
|
|
207
|
+
: config.accountId;
|
|
208
|
+
const paramsWithoutAccount = { ...params };
|
|
209
|
+
delete paramsWithoutAccount['account_id'];
|
|
210
|
+
const { pathParams, queryParams, bodyParams } = separateParams(paramsWithoutAccount, endpoint.params);
|
|
211
|
+
const path = substitutePath(endpoint.path, effectiveAccountId, pathParams);
|
|
186
212
|
const queryStr = buildQueryString(queryParams);
|
|
187
213
|
const fullPath = queryStr ? `${path}${queryStr}` : path;
|
|
188
214
|
const result = await client.request({
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,mFAAmF;AAEnF,OAAO,EAAE,CAAC,EAAc,MAAM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;QACtB,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7D,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,sEAAsE;IACtE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC7B,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,6DAA6D;IAC7D,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;QAChC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;IAED,wEAAwE;IACxE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,0BAA0B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,kCAAkC;AAChE,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -46,6 +46,7 @@ export function formatResponse(data) {
|
|
|
46
46
|
return text;
|
|
47
47
|
}
|
|
48
48
|
// AIDEV-NOTE: Route each input param to path/query/body based on endpoint parameter definitions
|
|
49
|
+
// Supports nested body params via dot-notation: `config.temperature` becomes body.config.temperature
|
|
49
50
|
export function separateParams(input, paramDefs) {
|
|
50
51
|
const pathParams = {};
|
|
51
52
|
const queryParams = {};
|
|
@@ -55,23 +56,90 @@ export function separateParams(input, paramDefs) {
|
|
|
55
56
|
for (const def of paramDefs) {
|
|
56
57
|
locationMap.set(def.name, def.location);
|
|
57
58
|
}
|
|
59
|
+
// AIDEV-NOTE: Helper that places a value into bodyParams, expanding dot-notation
|
|
60
|
+
// names into nested objects. Example: `config.temperature` => body.config.temperature
|
|
61
|
+
// Rationale: Rails strong_params expect nested objects (e.g. assistant: { config: {...} })
|
|
62
|
+
// not flat keys with dots. Without this expansion the backend silently drops the field.
|
|
63
|
+
const assignBody = (name, value) => {
|
|
64
|
+
const dotIdx = name.indexOf('.');
|
|
65
|
+
if (dotIdx <= 0) {
|
|
66
|
+
// AIDEV-NOTE: Merge plain objects to avoid clobbering when caller mixes
|
|
67
|
+
// `config: {...}` and `config.X` in the same input (P0 fix 2026-05-05).
|
|
68
|
+
const existingTop = bodyParams[name];
|
|
69
|
+
if (value && typeof value === 'object' && !Array.isArray(value) &&
|
|
70
|
+
existingTop && typeof existingTop === 'object' && !Array.isArray(existingTop)) {
|
|
71
|
+
bodyParams[name] = { ...existingTop, ...value };
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
bodyParams[name] = value;
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const root = name.slice(0, dotIdx);
|
|
79
|
+
const leaf = name.slice(dotIdx + 1);
|
|
80
|
+
const existing = bodyParams[root];
|
|
81
|
+
const target = existing && typeof existing === 'object' && !Array.isArray(existing)
|
|
82
|
+
? existing
|
|
83
|
+
: {};
|
|
84
|
+
// AIDEV-NOTE: Recurse to support multi-level dot-notation (a.b.c)
|
|
85
|
+
const nested = target;
|
|
86
|
+
const innerDot = leaf.indexOf('.');
|
|
87
|
+
if (innerDot <= 0) {
|
|
88
|
+
nested[leaf] = value;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// AIDEV-NOTE: Build deeper nesting by reusing assignBody logic on a temp container
|
|
92
|
+
const subPath = leaf;
|
|
93
|
+
const subRoot = subPath.slice(0, innerDot);
|
|
94
|
+
const subRest = subPath.slice(innerDot + 1);
|
|
95
|
+
const subExisting = nested[subRoot];
|
|
96
|
+
const subTarget = subExisting && typeof subExisting === 'object' && !Array.isArray(subExisting)
|
|
97
|
+
? subExisting
|
|
98
|
+
: {};
|
|
99
|
+
// Iteratively walk the rest of the path
|
|
100
|
+
let cursor = subTarget;
|
|
101
|
+
let remaining = subRest;
|
|
102
|
+
while (true) {
|
|
103
|
+
const idx = remaining.indexOf('.');
|
|
104
|
+
if (idx <= 0) {
|
|
105
|
+
cursor[remaining] = value;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
const head = remaining.slice(0, idx);
|
|
109
|
+
const tail = remaining.slice(idx + 1);
|
|
110
|
+
const next = cursor[head];
|
|
111
|
+
const nextObj = next && typeof next === 'object' && !Array.isArray(next)
|
|
112
|
+
? next
|
|
113
|
+
: {};
|
|
114
|
+
cursor[head] = nextObj;
|
|
115
|
+
cursor = nextObj;
|
|
116
|
+
remaining = tail;
|
|
117
|
+
}
|
|
118
|
+
nested[subRoot] = subTarget;
|
|
119
|
+
}
|
|
120
|
+
bodyParams[root] = target;
|
|
121
|
+
};
|
|
58
122
|
for (const [key, value] of Object.entries(input)) {
|
|
123
|
+
if (value === undefined) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
59
126
|
const location = locationMap.get(key);
|
|
60
127
|
switch (location) {
|
|
61
128
|
case 'path':
|
|
62
129
|
pathParams[key] = value;
|
|
63
130
|
break;
|
|
64
131
|
case 'query':
|
|
65
|
-
if (value !== null
|
|
132
|
+
if (value !== null) {
|
|
66
133
|
queryParams[key] = String(value);
|
|
67
134
|
}
|
|
68
135
|
break;
|
|
69
136
|
case 'body':
|
|
70
|
-
|
|
137
|
+
assignBody(key, value);
|
|
71
138
|
break;
|
|
72
139
|
default:
|
|
73
140
|
// AIDEV-NOTE: Params not in definitions go to body (catch-all for nested/extra fields)
|
|
74
|
-
|
|
141
|
+
// Honor dot-notation here too in case a caller forwards an undeclared nested field
|
|
142
|
+
assignBody(key, value);
|
|
75
143
|
break;
|
|
76
144
|
}
|
|
77
145
|
}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K,MAAM;gBACT,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACvB,MAAM;YACR;gBACE,uFAAuF;gBACvF,mFAAmF;gBACnF,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACvB,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AACjD,CAAC"}
|
package/endpoints.json
CHANGED
|
@@ -6414,37 +6414,30 @@
|
|
|
6414
6414
|
"method": "POST",
|
|
6415
6415
|
"path": "/api/v1/accounts/{account_id}/captain/assistants",
|
|
6416
6416
|
"title": "Criar Assistente IA",
|
|
6417
|
-
"description": "Cria
|
|
6417
|
+
"description": "Cria novo AI Agente. Body deve ter pelo menos `name` e `description`. `config.model` e auto-preenchido se ausente. **Requer perfil Administrador.**",
|
|
6418
6418
|
"category": "Assistentes",
|
|
6419
6419
|
"params": [
|
|
6420
|
-
{
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
},
|
|
6427
|
-
{
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
},
|
|
6434
|
-
{
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
}
|
|
6441
|
-
{
|
|
6442
|
-
"name": "system_prompt",
|
|
6443
|
-
"type": "string",
|
|
6444
|
-
"location": "body",
|
|
6445
|
-
"required": false,
|
|
6446
|
-
"description": "Prompt do sistema"
|
|
6447
|
-
}
|
|
6420
|
+
{ "name": "name", "type": "string", "location": "body", "required": true, "description": "Nome do agente" },
|
|
6421
|
+
{ "name": "description", "type": "string", "location": "body", "required": true, "description": "Descricao curta — obrigatoria pelo backend (validates :description, presence: true)" },
|
|
6422
|
+
{ "name": "response_guidelines", "type": "array", "location": "body", "required": false, "description": "Array de strings com diretrizes de resposta" },
|
|
6423
|
+
{ "name": "guardrails", "type": "array", "location": "body", "required": false, "description": "Array de strings com guardrails (proibicoes)" },
|
|
6424
|
+
{ "name": "config.model", "type": "string", "location": "body", "required": false, "description": "Modelo LLM (gpt-4o-mini, gpt-4o, etc). Default: openai_model da conta ou LlmConstants::DEFAULT_MODEL" },
|
|
6425
|
+
{ "name": "config.instructions", "type": "string", "location": "body", "required": false, "description": "System prompt do agente" },
|
|
6426
|
+
{ "name": "config.temperature", "type": "number", "location": "body", "required": false, "description": "Temperatura LLM (0.0-2.0)" },
|
|
6427
|
+
{ "name": "config.activation_label", "type": "string", "location": "body", "required": false, "description": "Tag/label que ativa este agente em conversas (legacy — nova ativacao usa FK direta)" },
|
|
6428
|
+
{ "name": "config.feature_faq", "type": "boolean", "location": "body", "required": false, "description": "Habilita busca em FAQ/base de conhecimento" },
|
|
6429
|
+
{ "name": "config.feature_memory", "type": "boolean", "location": "body", "required": false, "description": "Habilita memoria de longo prazo do contato" },
|
|
6430
|
+
{ "name": "config.feature_citation", "type": "boolean", "location": "body", "required": false, "description": "Mostra fontes citadas nas respostas" },
|
|
6431
|
+
{ "name": "config.welcome_message", "type": "string", "location": "body", "required": false, "description": "Mensagem inicial enviada ao ativar o agente" },
|
|
6432
|
+
{ "name": "config.min_response_time", "type": "integer", "location": "body", "required": false, "description": "Delay minimo de resposta em segundos" },
|
|
6433
|
+
{ "name": "config.max_response_time", "type": "integer", "location": "body", "required": false, "description": "Delay maximo de resposta em segundos" },
|
|
6434
|
+
{ "name": "config.feature_follow_up", "type": "boolean", "location": "body", "required": false, "description": "Habilita follow-up automatico" },
|
|
6435
|
+
{ "name": "config.follow_up_time", "type": "integer", "location": "body", "required": false, "description": "Tempo em minutos pra disparar follow-up" },
|
|
6436
|
+
{ "name": "config.follow_up_prompt", "type": "string", "location": "body", "required": false, "description": "Instrucao IA para redigir o follow-up" },
|
|
6437
|
+
{ "name": "config.disabled_tools", "type": "array", "location": "body", "required": false, "description": "Array de IDs de tools nativas desabilitadas. Lista canonica em GET /captain/assistants/tools" },
|
|
6438
|
+
{ "name": "config.offer_ids", "type": "array", "location": "body", "required": false, "description": "Array de IDs de ofertas que o agente pode consultar" },
|
|
6439
|
+
{ "name": "config.media_asset_ids", "type": "array", "location": "body", "required": false, "description": "Array de IDs de Captain::MediaAsset que o agente pode enviar" },
|
|
6440
|
+
{ "name": "config.booking_event_type_ids", "type": "array", "location": "body", "required": false, "description": "Array de IDs de tipos de agendamento que o agente pode oferecer" }
|
|
6448
6441
|
]
|
|
6449
6442
|
},
|
|
6450
6443
|
{
|
|
@@ -6469,37 +6462,31 @@
|
|
|
6469
6462
|
"method": "PATCH",
|
|
6470
6463
|
"path": "/api/v1/accounts/{account_id}/captain/assistants/{id}",
|
|
6471
6464
|
"title": "Atualizar Assistente IA",
|
|
6472
|
-
"description": "Atualiza
|
|
6465
|
+
"description": "Atualiza configuracao de um AI Agente. Todos os campos sao opcionais. Use dot-notation (config.X) para campos aninhados.",
|
|
6473
6466
|
"category": "Assistentes",
|
|
6474
6467
|
"params": [
|
|
6475
|
-
{
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
},
|
|
6482
|
-
{
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
},
|
|
6489
|
-
{
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
},
|
|
6496
|
-
{
|
|
6497
|
-
"name": "active",
|
|
6498
|
-
"type": "boolean",
|
|
6499
|
-
"location": "body",
|
|
6500
|
-
"required": false,
|
|
6501
|
-
"description": "Ativo"
|
|
6502
|
-
}
|
|
6468
|
+
{ "name": "id", "type": "integer", "location": "path", "required": true, "description": "ID do agente" },
|
|
6469
|
+
{ "name": "name", "type": "string", "location": "body", "required": false, "description": "Nome do agente" },
|
|
6470
|
+
{ "name": "description", "type": "string", "location": "body", "required": false, "description": "Descricao curta" },
|
|
6471
|
+
{ "name": "response_guidelines", "type": "array", "location": "body", "required": false, "description": "Array de strings com diretrizes de resposta" },
|
|
6472
|
+
{ "name": "guardrails", "type": "array", "location": "body", "required": false, "description": "Array de strings com guardrails (proibicoes)" },
|
|
6473
|
+
{ "name": "config.model", "type": "string", "location": "body", "required": false, "description": "Modelo LLM (gpt-4o-mini, gpt-4o, etc)" },
|
|
6474
|
+
{ "name": "config.instructions", "type": "string", "location": "body", "required": false, "description": "System prompt do agente" },
|
|
6475
|
+
{ "name": "config.temperature", "type": "number", "location": "body", "required": false, "description": "Temperatura LLM (0.0-2.0)" },
|
|
6476
|
+
{ "name": "config.activation_label", "type": "string", "location": "body", "required": false, "description": "Tag/label que ativa este agente em conversas (legacy)" },
|
|
6477
|
+
{ "name": "config.feature_faq", "type": "boolean", "location": "body", "required": false, "description": "Habilita busca em FAQ/base de conhecimento" },
|
|
6478
|
+
{ "name": "config.feature_memory", "type": "boolean", "location": "body", "required": false, "description": "Habilita memoria de longo prazo do contato" },
|
|
6479
|
+
{ "name": "config.feature_citation", "type": "boolean", "location": "body", "required": false, "description": "Mostra fontes citadas nas respostas" },
|
|
6480
|
+
{ "name": "config.welcome_message", "type": "string", "location": "body", "required": false, "description": "Mensagem inicial enviada ao ativar o agente" },
|
|
6481
|
+
{ "name": "config.min_response_time", "type": "integer", "location": "body", "required": false, "description": "Delay minimo de resposta em segundos" },
|
|
6482
|
+
{ "name": "config.max_response_time", "type": "integer", "location": "body", "required": false, "description": "Delay maximo de resposta em segundos" },
|
|
6483
|
+
{ "name": "config.feature_follow_up", "type": "boolean", "location": "body", "required": false, "description": "Habilita follow-up automatico" },
|
|
6484
|
+
{ "name": "config.follow_up_time", "type": "integer", "location": "body", "required": false, "description": "Tempo em minutos pra disparar follow-up" },
|
|
6485
|
+
{ "name": "config.follow_up_prompt", "type": "string", "location": "body", "required": false, "description": "Instrucao IA para redigir o follow-up" },
|
|
6486
|
+
{ "name": "config.disabled_tools", "type": "array", "location": "body", "required": false, "description": "Array de IDs de tools nativas desabilitadas. Lista canonica em GET /captain/assistants/tools" },
|
|
6487
|
+
{ "name": "config.offer_ids", "type": "array", "location": "body", "required": false, "description": "Array de IDs de ofertas que o agente pode consultar" },
|
|
6488
|
+
{ "name": "config.media_asset_ids", "type": "array", "location": "body", "required": false, "description": "Array de IDs de Captain::MediaAsset que o agente pode enviar" },
|
|
6489
|
+
{ "name": "config.booking_event_type_ids", "type": "array", "location": "body", "required": false, "description": "Array de IDs de tipos de agendamento que o agente pode oferecer" }
|
|
6503
6490
|
]
|
|
6504
6491
|
},
|
|
6505
6492
|
{
|
|
@@ -6519,6 +6506,30 @@
|
|
|
6519
6506
|
}
|
|
6520
6507
|
]
|
|
6521
6508
|
},
|
|
6509
|
+
{
|
|
6510
|
+
"id": "lionchat_captain_assistants_tools",
|
|
6511
|
+
"method": "GET",
|
|
6512
|
+
"path": "/api/v1/accounts/{account_id}/captain/assistants/tools",
|
|
6513
|
+
"title": "Listar Tools Disponiveis",
|
|
6514
|
+
"description": "Lista todas as tools nativas (built-in) e custom da conta. Se assistant_id presente, marca enabled/disabled por tool baseado em config.disabled_tools.",
|
|
6515
|
+
"category": "Assistentes",
|
|
6516
|
+
"params": [
|
|
6517
|
+
{ "name": "assistant_id", "type": "integer", "location": "query", "required": false, "description": "Se informado, marca enabled/disabled por tool desse assistant" }
|
|
6518
|
+
]
|
|
6519
|
+
},
|
|
6520
|
+
{
|
|
6521
|
+
"id": "lionchat_captain_assistants_playground",
|
|
6522
|
+
"method": "POST",
|
|
6523
|
+
"path": "/api/v1/accounts/{account_id}/captain/assistants/{id}/playground",
|
|
6524
|
+
"title": "Testar Agente (Playground)",
|
|
6525
|
+
"description": "Roda mensagem de teste sem criar conversa real. Retorna a resposta do agente.",
|
|
6526
|
+
"category": "Assistentes",
|
|
6527
|
+
"params": [
|
|
6528
|
+
{ "name": "id", "type": "integer", "location": "path", "required": true, "description": "ID do agente" },
|
|
6529
|
+
{ "name": "message_content", "type": "string", "location": "body", "required": true, "description": "Mensagem do usuario para teste" },
|
|
6530
|
+
{ "name": "message_history", "type": "array", "location": "body", "required": false, "description": "Historico (array de {role, content})" }
|
|
6531
|
+
]
|
|
6532
|
+
},
|
|
6522
6533
|
{
|
|
6523
6534
|
"id": "lionchat_captain_documents_list",
|
|
6524
6535
|
"method": "GET",
|
|
@@ -11135,7 +11146,7 @@
|
|
|
11135
11146
|
"type": "string",
|
|
11136
11147
|
"location": "query",
|
|
11137
11148
|
"required": false,
|
|
11138
|
-
"description": "
|
|
11149
|
+
"description": "Escopo: account|inbox|agent|label|team. Default: account"
|
|
11139
11150
|
},
|
|
11140
11151
|
{
|
|
11141
11152
|
"name": "since",
|
|
@@ -11156,7 +11167,7 @@
|
|
|
11156
11167
|
"type": "string",
|
|
11157
11168
|
"location": "query",
|
|
11158
11169
|
"required": false,
|
|
11159
|
-
"description": "ID
|
|
11170
|
+
"description": "ID da entidade quando type != account"
|
|
11160
11171
|
},
|
|
11161
11172
|
{
|
|
11162
11173
|
"name": "group_by",
|
|
@@ -11164,6 +11175,20 @@
|
|
|
11164
11175
|
"location": "query",
|
|
11165
11176
|
"required": false,
|
|
11166
11177
|
"description": "Agrupar por: day, week, month, year"
|
|
11178
|
+
},
|
|
11179
|
+
{
|
|
11180
|
+
"name": "business_hours",
|
|
11181
|
+
"type": "boolean",
|
|
11182
|
+
"location": "query",
|
|
11183
|
+
"required": false,
|
|
11184
|
+
"description": "Filtrar por horario comercial"
|
|
11185
|
+
},
|
|
11186
|
+
{
|
|
11187
|
+
"name": "timezone_offset",
|
|
11188
|
+
"type": "string",
|
|
11189
|
+
"location": "query",
|
|
11190
|
+
"required": false,
|
|
11191
|
+
"description": "Offset de timezone em horas"
|
|
11167
11192
|
}
|
|
11168
11193
|
]
|
|
11169
11194
|
},
|
|
@@ -11175,20 +11200,12 @@
|
|
|
11175
11200
|
"description": "Retorna resumo geral de metricas.",
|
|
11176
11201
|
"category": "Relatorios",
|
|
11177
11202
|
"params": [
|
|
11178
|
-
{
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
},
|
|
11185
|
-
{
|
|
11186
|
-
"name": "until",
|
|
11187
|
-
"type": "string",
|
|
11188
|
-
"location": "query",
|
|
11189
|
-
"required": false,
|
|
11190
|
-
"description": "Timestamp fim"
|
|
11191
|
-
}
|
|
11203
|
+
{ "name": "since", "type": "string", "location": "query", "required": false, "description": "Timestamp inicio" },
|
|
11204
|
+
{ "name": "until", "type": "string", "location": "query", "required": false, "description": "Timestamp fim" },
|
|
11205
|
+
{ "name": "type", "type": "string", "location": "query", "required": false, "description": "Escopo: account|inbox|agent|label|team. Default: account" },
|
|
11206
|
+
{ "name": "id", "type": "string", "location": "query", "required": false, "description": "ID da entidade quando type != account" },
|
|
11207
|
+
{ "name": "business_hours", "type": "boolean", "location": "query", "required": false, "description": "Filtrar por horario comercial" },
|
|
11208
|
+
{ "name": "timezone_offset", "type": "string", "location": "query", "required": false, "description": "Offset de timezone em horas" }
|
|
11192
11209
|
]
|
|
11193
11210
|
},
|
|
11194
11211
|
{
|
|
@@ -11198,7 +11215,14 @@
|
|
|
11198
11215
|
"title": "Resumo do Bot",
|
|
11199
11216
|
"description": "Retorna resumo de atendimentos do bot.",
|
|
11200
11217
|
"category": "Relatorios",
|
|
11201
|
-
"params": [
|
|
11218
|
+
"params": [
|
|
11219
|
+
{ "name": "since", "type": "string", "location": "query", "required": false, "description": "Timestamp inicio" },
|
|
11220
|
+
{ "name": "until", "type": "string", "location": "query", "required": false, "description": "Timestamp fim" },
|
|
11221
|
+
{ "name": "type", "type": "string", "location": "query", "required": false, "description": "Escopo: account|inbox|agent|label|team. Default: account" },
|
|
11222
|
+
{ "name": "id", "type": "string", "location": "query", "required": false, "description": "ID da entidade quando type != account" },
|
|
11223
|
+
{ "name": "business_hours", "type": "boolean", "location": "query", "required": false, "description": "Filtrar por horario comercial" },
|
|
11224
|
+
{ "name": "timezone_offset", "type": "string", "location": "query", "required": false, "description": "Offset de timezone em horas" }
|
|
11225
|
+
]
|
|
11202
11226
|
},
|
|
11203
11227
|
{
|
|
11204
11228
|
"id": "lionchat_reports_list_7",
|
|
@@ -11386,7 +11410,7 @@
|
|
|
11386
11410
|
"method": "POST",
|
|
11387
11411
|
"path": "/api/v1/accounts/{account_id}/captain/assistants/{assistant_id}/scenarios",
|
|
11388
11412
|
"title": "Criar Cenario",
|
|
11389
|
-
"description": "Cria um novo cenario para o assistente.",
|
|
11413
|
+
"description": "Cria um novo cenario para o assistente. Use `tool://tool_id` no markdown da `instruction` para referenciar tools — sao resolvidas automaticamente pelo backend (campo `tools` e read-only).",
|
|
11390
11414
|
"category": "Assistentes",
|
|
11391
11415
|
"params": [
|
|
11392
11416
|
{
|
|
@@ -11404,11 +11428,25 @@
|
|
|
11404
11428
|
"description": "Titulo do cenario"
|
|
11405
11429
|
},
|
|
11406
11430
|
{
|
|
11407
|
-
"name": "
|
|
11431
|
+
"name": "description",
|
|
11432
|
+
"type": "string",
|
|
11433
|
+
"location": "body",
|
|
11434
|
+
"required": true,
|
|
11435
|
+
"description": "Descricao quando o cenario aplica"
|
|
11436
|
+
},
|
|
11437
|
+
{
|
|
11438
|
+
"name": "instruction",
|
|
11408
11439
|
"type": "string",
|
|
11409
11440
|
"location": "body",
|
|
11410
11441
|
"required": true,
|
|
11411
|
-
"description": "
|
|
11442
|
+
"description": "Instrucao do cenario (markdown). Pode conter referencias de tools com sintaxe `[Label](tool://tool_id)`"
|
|
11443
|
+
},
|
|
11444
|
+
{
|
|
11445
|
+
"name": "enabled",
|
|
11446
|
+
"type": "boolean",
|
|
11447
|
+
"location": "body",
|
|
11448
|
+
"required": false,
|
|
11449
|
+
"description": "Toggle ativo/inativo (default true)"
|
|
11412
11450
|
}
|
|
11413
11451
|
]
|
|
11414
11452
|
},
|
|
@@ -11441,7 +11479,7 @@
|
|
|
11441
11479
|
"method": "PUT",
|
|
11442
11480
|
"path": "/api/v1/accounts/{account_id}/captain/assistants/{assistant_id}/scenarios/{id}",
|
|
11443
11481
|
"title": "Atualizar Cenario",
|
|
11444
|
-
"description": "Atualiza um cenario do assistente.",
|
|
11482
|
+
"description": "Atualiza um cenario do assistente. Campo `tools` e read-only — referencias sao derivadas do markdown da `instruction` via sintaxe `[Label](tool://tool_id)`.",
|
|
11445
11483
|
"category": "Assistentes",
|
|
11446
11484
|
"params": [
|
|
11447
11485
|
{
|
|
@@ -11466,11 +11504,25 @@
|
|
|
11466
11504
|
"description": "Titulo"
|
|
11467
11505
|
},
|
|
11468
11506
|
{
|
|
11469
|
-
"name": "
|
|
11507
|
+
"name": "description",
|
|
11470
11508
|
"type": "string",
|
|
11471
11509
|
"location": "body",
|
|
11472
11510
|
"required": false,
|
|
11473
|
-
"description": "
|
|
11511
|
+
"description": "Descricao quando o cenario aplica (opcional em update — obrigatorio so no create)"
|
|
11512
|
+
},
|
|
11513
|
+
{
|
|
11514
|
+
"name": "instruction",
|
|
11515
|
+
"type": "string",
|
|
11516
|
+
"location": "body",
|
|
11517
|
+
"required": false,
|
|
11518
|
+
"description": "Instrucao do cenario (markdown). Pode conter referencias de tools com sintaxe `[Label](tool://tool_id)`"
|
|
11519
|
+
},
|
|
11520
|
+
{
|
|
11521
|
+
"name": "enabled",
|
|
11522
|
+
"type": "boolean",
|
|
11523
|
+
"location": "body",
|
|
11524
|
+
"required": false,
|
|
11525
|
+
"description": "Toggle ativo/inativo"
|
|
11474
11526
|
}
|
|
11475
11527
|
]
|
|
11476
11528
|
},
|
|
@@ -11502,19 +11554,31 @@
|
|
|
11502
11554
|
"id": "lionchat_captain_assistants_list_4",
|
|
11503
11555
|
"method": "GET",
|
|
11504
11556
|
"path": "/api/v1/accounts/{account_id}/captain/assistant_responses",
|
|
11505
|
-
"title": "Listar Respostas",
|
|
11506
|
-
"description": "Lista respostas configuradas
|
|
11557
|
+
"title": "Listar Respostas (FAQs)",
|
|
11558
|
+
"description": "Lista FAQs/respostas configuradas. Filtros opcionais: assistant_id, document_id, status, search.",
|
|
11507
11559
|
"category": "Assistentes",
|
|
11508
|
-
"params": [
|
|
11560
|
+
"params": [
|
|
11561
|
+
{ "name": "assistant_id", "type": "integer", "location": "query", "required": false, "description": "Filtra por agente dono da FAQ" },
|
|
11562
|
+
{ "name": "document_id", "type": "integer", "location": "query", "required": false, "description": "Filtra por documento de origem" },
|
|
11563
|
+
{ "name": "status", "type": "string", "location": "query", "required": false, "description": "approved | pending" },
|
|
11564
|
+
{ "name": "search", "type": "string", "location": "query", "required": false, "description": "Busca textual em pergunta/resposta" }
|
|
11565
|
+
]
|
|
11509
11566
|
},
|
|
11510
11567
|
{
|
|
11511
11568
|
"id": "lionchat_captain_assistants_create_2",
|
|
11512
11569
|
"method": "POST",
|
|
11513
11570
|
"path": "/api/v1/accounts/{account_id}/captain/assistant_responses",
|
|
11514
|
-
"title": "Criar Resposta",
|
|
11515
|
-
"description": "Cria uma nova
|
|
11571
|
+
"title": "Criar Resposta (FAQ)",
|
|
11572
|
+
"description": "Cria uma nova FAQ vinculada a um agente. assistant_id e obrigatorio (NOT NULL no banco).",
|
|
11516
11573
|
"category": "Assistentes",
|
|
11517
11574
|
"params": [
|
|
11575
|
+
{
|
|
11576
|
+
"name": "assistant_id",
|
|
11577
|
+
"type": "integer",
|
|
11578
|
+
"location": "body",
|
|
11579
|
+
"required": true,
|
|
11580
|
+
"description": "ID do agente dono da FAQ — NOT NULL no banco"
|
|
11581
|
+
},
|
|
11518
11582
|
{
|
|
11519
11583
|
"name": "question",
|
|
11520
11584
|
"type": "string",
|
|
@@ -11528,6 +11592,13 @@
|
|
|
11528
11592
|
"location": "body",
|
|
11529
11593
|
"required": true,
|
|
11530
11594
|
"description": "Resposta"
|
|
11595
|
+
},
|
|
11596
|
+
{
|
|
11597
|
+
"name": "status",
|
|
11598
|
+
"type": "string",
|
|
11599
|
+
"location": "body",
|
|
11600
|
+
"required": false,
|
|
11601
|
+
"description": "approved (em uso) ou pending (aguardando revisao). Default: approved"
|
|
11531
11602
|
}
|
|
11532
11603
|
]
|
|
11533
11604
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lionchat/mcp-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "MCP server for LionChat API —
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "MCP server for LionChat API — 547 tools for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dev": "tsc --watch",
|
|
15
15
|
"extract": "npx tsx scripts/extract-endpoints.ts"
|
|
16
16
|
},
|
|
17
|
-
"files": ["dist", "endpoints.json", "README.md"],
|
|
17
|
+
"files": ["dist", "endpoints.json", "README.md", "CHANGELOG.md"],
|
|
18
18
|
"keywords": ["mcp", "lionchat", "chatwoot", "whatsapp", "crm", "ai-agent", "kanban"],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"engines": {
|