@formmy.app/mcp-server 0.2.0 → 0.3.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/dist/index.js +1 -1
- package/dist/sdk-client.d.ts +1 -0
- package/dist/sdk-client.js +3 -0
- package/dist/tools/conversations.js +7 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/sdk-client.ts +4 -0
- package/src/tools/conversations.ts +13 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { registerDocumentTools } from "./tools/documents.js";
|
|
|
7
7
|
import { registerConversationTools } from "./tools/conversations.js";
|
|
8
8
|
const server = new McpServer({
|
|
9
9
|
name: "formmy",
|
|
10
|
-
version: "0.
|
|
10
|
+
version: "0.3.0",
|
|
11
11
|
});
|
|
12
12
|
registerAgentTools(server);
|
|
13
13
|
registerChatTools(server);
|
package/dist/sdk-client.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare function updateDocument(documentId: string, data: {
|
|
|
29
29
|
export declare function deleteDocument(documentId: string): Promise<unknown>;
|
|
30
30
|
export declare function listConversations(agentId: string): Promise<unknown>;
|
|
31
31
|
export declare function getConversation(conversationId: string): Promise<unknown>;
|
|
32
|
+
export declare function listConversationEstados(agentId: string): Promise<unknown>;
|
|
32
33
|
export declare function setConversationStatus(conversationId: string, label: string, color: string): Promise<unknown>;
|
|
33
34
|
export declare function addConversationTag(conversationId: string, label: string, color: string, comment?: string): Promise<unknown>;
|
|
34
35
|
export declare function removeConversationTag(conversationId: string, tagLabel: string): Promise<unknown>;
|
package/dist/sdk-client.js
CHANGED
|
@@ -124,6 +124,9 @@ export async function listConversations(agentId) {
|
|
|
124
124
|
export async function getConversation(conversationId) {
|
|
125
125
|
return sdkFetch("conversations.get", { params: { conversationId } });
|
|
126
126
|
}
|
|
127
|
+
export async function listConversationEstados(agentId) {
|
|
128
|
+
return sdkFetch("conversations.estados", { params: { agentId } });
|
|
129
|
+
}
|
|
127
130
|
// --- Agent bridge mutations (NANOCLAW_WEBHOOK_SECRET auth) ---
|
|
128
131
|
// Pega a /api/v1/agents/conversations, no a /api/v2/sdk. Usa Bearer con el
|
|
129
132
|
// mismo secret que ya autentica el puente Formmy ↔ NanoClaw bidireccional,
|
|
@@ -13,7 +13,13 @@ export function registerConversationTools(server) {
|
|
|
13
13
|
const result = await sdk.getConversation(conversationId);
|
|
14
14
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
15
15
|
});
|
|
16
|
-
server.tool("
|
|
16
|
+
server.tool("list_conversation_estados", "List the valid CRM estados (kanban columns) configured for this agent. ALWAYS call this before set_conversation_status so you move leads within the defined set instead of inventing new labels/colors. Returns an array of { label, color }. Pick the closest matching estado and reuse its exact label and color.", {
|
|
17
|
+
agentId: z.string().describe("Agent ID or slug"),
|
|
18
|
+
}, async ({ agentId }) => {
|
|
19
|
+
const result = await sdk.listConversationEstados(agentId);
|
|
20
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
21
|
+
});
|
|
22
|
+
server.tool("set_conversation_status", "Set the CRM status (estado) of a conversation. Use when the user signals a clear state change: payment confirmed → 'Pago confirmado' (#10B981), needs human → 'Solo operador' (#3B82F6), in progress → 'Atendiendo' (#F59E0B), resolved → 'Atendido' (#10B981). label is free-form text; color must be a hex string. Prefer reusing a label/color from list_conversation_estados. The operator sees the new chip in the conversations list immediately.", {
|
|
17
23
|
conversationId: z.string().describe("Conversation ID"),
|
|
18
24
|
label: z.string().describe("Status label, e.g. 'Pago confirmado', 'Solo operador'"),
|
|
19
25
|
color: z.string().describe("Hex color, e.g. '#10B981' (green), '#3B82F6' (blue), '#F59E0B' (amber), '#EF4444' (red)"),
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/sdk-client.ts
CHANGED
|
@@ -184,6 +184,10 @@ export async function getConversation(conversationId: string) {
|
|
|
184
184
|
return sdkFetch("conversations.get", { params: { conversationId } });
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
export async function listConversationEstados(agentId: string) {
|
|
188
|
+
return sdkFetch("conversations.estados", { params: { agentId } });
|
|
189
|
+
}
|
|
190
|
+
|
|
187
191
|
// --- Agent bridge mutations (NANOCLAW_WEBHOOK_SECRET auth) ---
|
|
188
192
|
// Pega a /api/v1/agents/conversations, no a /api/v2/sdk. Usa Bearer con el
|
|
189
193
|
// mismo secret que ya autentica el puente Formmy ↔ NanoClaw bidireccional,
|
|
@@ -27,9 +27,21 @@ export function registerConversationTools(server: McpServer) {
|
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
|
|
30
|
+
server.tool(
|
|
31
|
+
"list_conversation_estados",
|
|
32
|
+
"List the valid CRM estados (kanban columns) configured for this agent. ALWAYS call this before set_conversation_status so you move leads within the defined set instead of inventing new labels/colors. Returns an array of { label, color }. Pick the closest matching estado and reuse its exact label and color.",
|
|
33
|
+
{
|
|
34
|
+
agentId: z.string().describe("Agent ID or slug"),
|
|
35
|
+
},
|
|
36
|
+
async ({ agentId }) => {
|
|
37
|
+
const result = await sdk.listConversationEstados(agentId);
|
|
38
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
30
42
|
server.tool(
|
|
31
43
|
"set_conversation_status",
|
|
32
|
-
"Set the CRM status (estado) of a conversation. Use when the user signals a clear state change: payment confirmed → 'Pago confirmado' (#10B981), needs human → 'Solo operador' (#3B82F6), in progress → 'Atendiendo' (#F59E0B), resolved → 'Atendido' (#10B981). label is free-form text; color must be a hex string. The operator sees the new chip in the conversations list immediately.",
|
|
44
|
+
"Set the CRM status (estado) of a conversation. Use when the user signals a clear state change: payment confirmed → 'Pago confirmado' (#10B981), needs human → 'Solo operador' (#3B82F6), in progress → 'Atendiendo' (#F59E0B), resolved → 'Atendido' (#10B981). label is free-form text; color must be a hex string. Prefer reusing a label/color from list_conversation_estados. The operator sees the new chip in the conversations list immediately.",
|
|
33
45
|
{
|
|
34
46
|
conversationId: z.string().describe("Conversation ID"),
|
|
35
47
|
label: z.string().describe("Status label, e.g. 'Pago confirmado', 'Solo operador'"),
|