@servicialo/mcp-server 0.4.0 → 0.5.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/README.md +26 -15
- package/dist/index.js +1 -1
- package/dist/tools/authenticated/cerrar.js +2 -2
- package/dist/tools/authenticated/cerrar.js.map +1 -1
- package/dist/tools/authenticated/delivery.js +1 -1
- package/dist/tools/authenticated/delivery.js.map +1 -1
- package/dist/tools/authenticated/entender.js +1 -1
- package/dist/tools/authenticated/entender.js.map +1 -1
- package/dist/tools/authenticated/lifecycle.d.ts +3 -3
- package/dist/tools/authenticated/lifecycle.js +3 -3
- package/dist/tools/authenticated/lifecycle.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
MCP server for the [Servicialo](https://servicialo.com) protocol. Connects AI agents to professional services via any Servicialo-compatible platform.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
23 tools organized by the 6 lifecycle phases of a service — not by database table.
|
|
6
6
|
|
|
7
7
|
## Two Modes of Operation
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ No credentials needed. 4 public tools for discovering organizations, services, a
|
|
|
20
20
|
SERVICIALO_API_KEY=your_key SERVICIALO_ORG_ID=your_org npx -y @servicialo/mcp-server
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Requires `SERVICIALO_API_KEY` and `SERVICIALO_ORG_ID`. Enables all
|
|
23
|
+
Requires `SERVICIALO_API_KEY` and `SERVICIALO_ORG_ID`. Enables all 23 tools across the full service lifecycle.
|
|
24
24
|
|
|
25
25
|
### Claude Desktop Configuration
|
|
26
26
|
|
|
@@ -75,7 +75,7 @@ A well-designed agent follows this order. Each phase has its tools. The standard
|
|
|
75
75
|
|
|
76
76
|
| Tool | Description |
|
|
77
77
|
|---|---|
|
|
78
|
-
| `service.get` | Get the
|
|
78
|
+
| `service.get` | Get the 8 dimensions of a service: what, who delivers, who receives (with separate payer), when, where, lifecycle, evidence, billing |
|
|
79
79
|
| `contract.get` | Get the pre-agreed service contract: required evidence, cancellation policy, no-show policy, dispute terms |
|
|
80
80
|
|
|
81
81
|
## Phase 3 — Comprometer (3 tools)
|
|
@@ -91,7 +91,7 @@ A well-designed agent follows this order. Each phase has its tools. The standard
|
|
|
91
91
|
| Tool | Description |
|
|
92
92
|
|---|---|
|
|
93
93
|
| `lifecycle.get_state` | Get current lifecycle state, available transitions, and transition history |
|
|
94
|
-
| `lifecycle.transition` | Execute a state transition with evidence. Valid: requested→
|
|
94
|
+
| `lifecycle.transition` | Execute a state transition with evidence. Valid: requested→scheduled, scheduled→confirmed, confirmed→in_progress, in_progress→delivered, delivered→verified, verified→documented, documented→charged, any→cancelled |
|
|
95
95
|
| `scheduling.reschedule` | Exception flow: reschedule to new datetime. Contract rescheduling policy may apply |
|
|
96
96
|
| `scheduling.cancel` | Exception flow: cancel with contract cancellation policy applied |
|
|
97
97
|
|
|
@@ -100,7 +100,7 @@ A well-designed agent follows this order. Each phase has its tools. The standard
|
|
|
100
100
|
| Tool | Description |
|
|
101
101
|
|---|---|
|
|
102
102
|
| `delivery.checkin` | Provider/client check-in with GPS + timestamp → state "En Curso" |
|
|
103
|
-
| `delivery.checkout` | Check-out with GPS + timestamp → state "
|
|
103
|
+
| `delivery.checkout` | Check-out with GPS + timestamp → state "Entregado". Duration auto-calculated |
|
|
104
104
|
| `delivery.record_evidence` | Record delivery evidence per vertical: GPS, signature, photo, document, duration, notes |
|
|
105
105
|
|
|
106
106
|
## Phase 6 — Cerrar (4 tools)
|
|
@@ -108,8 +108,8 @@ A well-designed agent follows this order. Each phase has its tools. The standard
|
|
|
108
108
|
| Tool | Description |
|
|
109
109
|
|---|---|
|
|
110
110
|
| `documentation.create` | Generate service record (clinical note, inspection report, class minutes, etc.) → state "Documentado" |
|
|
111
|
-
| `payments.create_sale` | Create a sale/charge for the documented service → state "
|
|
112
|
-
| `payments.record_payment` | Record payment received.
|
|
111
|
+
| `payments.create_sale` | Create a sale/charge for the documented service → state "Cobrado" |
|
|
112
|
+
| `payments.record_payment` | Record payment received. Payment is independent from lifecycle — billing.status transitions from charged → invoiced → paid |
|
|
113
113
|
| `payments.get_status` | Get payment status for a sale or client account balance |
|
|
114
114
|
|
|
115
115
|
## End-to-End Example
|
|
@@ -125,14 +125,14 @@ scheduling.check_availability({ org_slug: "clinica-kinesia", date_from: "2026-03
|
|
|
125
125
|
→ available slots
|
|
126
126
|
|
|
127
127
|
service.get({ service_id: "srv_123" })
|
|
128
|
-
→
|
|
128
|
+
→ 8 dimensions: duration 45min, location presencial, billing, etc.
|
|
129
129
|
|
|
130
130
|
contract.get({ service_id: "srv_123", org_id: "org_456" })
|
|
131
131
|
→ evidence: check_in + check_out + clinical_record
|
|
132
132
|
→ cancellation: 0% if >24h, 50% if 2-24h, 100% if <2h
|
|
133
133
|
→ dispute window: 48 hours
|
|
134
134
|
|
|
135
|
-
clients.get_or_create({ email: "paciente@mail.com", name: "
|
|
135
|
+
clients.get_or_create({ email: "paciente@mail.com", name: "Maria", last_name: "Lopez", actor: { type: "agent", id: "agent_1" } })
|
|
136
136
|
→ client_id: "cli_789"
|
|
137
137
|
|
|
138
138
|
scheduling.book({ service_id: "srv_123", provider_id: "prov_111", client_id: "cli_789", starts_at: "2026-03-03T10:00:00", actor: { type: "agent", id: "agent_1" } })
|
|
@@ -145,19 +145,19 @@ delivery.checkin({ session_id: "ses_001", actor: { type: "provider", id: "prov_1
|
|
|
145
145
|
→ state: "in_progress"
|
|
146
146
|
|
|
147
147
|
delivery.checkout({ session_id: "ses_001", actor: { type: "provider", id: "prov_111" }, location: { lat: -33.45, lng: -70.66 } })
|
|
148
|
-
→ state: "
|
|
148
|
+
→ state: "delivered", duration: 42min
|
|
149
149
|
|
|
150
150
|
delivery.record_evidence({ session_id: "ses_001", evidence_type: "document", data: { type: "clinical_record", signed_by: ["prov_111", "cli_789"] }, actor: { type: "provider", id: "prov_111" } })
|
|
151
151
|
→ evidence recorded
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
lifecycle.transition({ session_id: "ses_001", to_state: "verified", actor: { type: "client", id: "cli_789" } })
|
|
154
|
+
→ state: "verified"
|
|
155
|
+
|
|
156
|
+
documentation.create({ session_id: "ses_001", content: "Sesion de rehabilitacion...", actor: { type: "provider", id: "prov_111" } })
|
|
154
157
|
→ state: "documented"
|
|
155
158
|
|
|
156
159
|
payments.create_sale({ client_id: "cli_789", service_id: "srv_123", provider_id: "prov_111", unit_price: 35000 })
|
|
157
|
-
→ sale_id: "sale_001", state: "
|
|
158
|
-
|
|
159
|
-
payments.record_payment({ venta_id: "sale_001", amount: 35000, method: "transferencia" })
|
|
160
|
-
→ state: "closed"
|
|
160
|
+
→ sale_id: "sale_001", state: "charged"
|
|
161
161
|
```
|
|
162
162
|
|
|
163
163
|
## Migration from v0.3
|
|
@@ -178,6 +178,17 @@ payments.record_payment({ venta_id: "sale_001", amount: 35000, method: "transfer
|
|
|
178
178
|
| `providers.get_commission` | Removed (not part of service lifecycle) |
|
|
179
179
|
| `payroll.*` (5 tools) | Removed (not part of service lifecycle) |
|
|
180
180
|
|
|
181
|
+
### Lifecycle state changes in v0.2
|
|
182
|
+
|
|
183
|
+
| v0.1 State | v0.2 State | Notes |
|
|
184
|
+
|---|---|---|
|
|
185
|
+
| Completed | Delivered | Renamed — provider marks delivery, not completion |
|
|
186
|
+
| Documented | Documented | Unchanged — but now comes after Verified |
|
|
187
|
+
| Invoiced | — | Removed from lifecycle — tracked in billing.status |
|
|
188
|
+
| Collected | — | Removed from lifecycle — tracked in billing.status |
|
|
189
|
+
| Verified | Verified | Moved from last to 6th — verification unlocks documentation and charging |
|
|
190
|
+
| — | Charged | New — charge applied 1:1 with verified session |
|
|
191
|
+
|
|
181
192
|
## Development
|
|
182
193
|
|
|
183
194
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export const cerrarTools = {
|
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
'payments.create_sale': {
|
|
21
|
-
description: '[Fase 6 — Cerrar] Crea una venta (cargo) asociada a un servicio documentado. Mueve la sesión a "
|
|
21
|
+
description: '[Fase 6 — Cerrar] Crea una venta (cargo) asociada a un servicio documentado. Mueve la sesión a "Cobrado". Debe llamarse después de documentation.create.',
|
|
22
22
|
schema: z.object({
|
|
23
23
|
client_id: z.string().describe('ID del cliente'),
|
|
24
24
|
service_id: z.string().describe('ID del servicio'),
|
|
@@ -37,7 +37,7 @@ export const cerrarTools = {
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
'payments.record_payment': {
|
|
40
|
-
description: '[Fase 6 — Cerrar] Registra un
|
|
40
|
+
description: '[Fase 6 — Cerrar] Registra un pago recibido contra una venta existente. El pago es independiente del ciclo de vida — billing.status transiciona de charged → invoiced → paid.',
|
|
41
41
|
schema: z.object({
|
|
42
42
|
venta_id: z.string().describe('ID de la venta'),
|
|
43
43
|
amount: z.number().describe('Monto cobrado'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cerrar.js","sourceRoot":"","sources":["../../../src/tools/authenticated/cerrar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,sBAAsB,EAAE;QACtB,WAAW,EACT,wKAAwK;QAC1K,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;YACpE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;YAC3F,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,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
|
'delivery.checkout': {
|
|
21
|
-
description: '[Fase 5 — Verificar entrega] Registra el check-out al finalizar el servicio, moviendo la sesión a "
|
|
21
|
+
description: '[Fase 5 — Verificar entrega] Registra el check-out al finalizar el servicio, moviendo la sesión a "Entregado". Captura timestamp y ubicación GPS. La duración real se calcula automáticamente.',
|
|
22
22
|
schema: z.object({
|
|
23
23
|
session_id: z.string().describe('ID de la sesión'),
|
|
24
24
|
actor: ActorSchema.describe('Quién hace check-out (provider o client)'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery.js","sourceRoot":"","sources":["../../../src/tools/authenticated/delivery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,kBAAkB,EAAE;QAClB,WAAW,EACT,qLAAqL;QACvL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,yCAAyC,CAAC;YACtE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;YACrF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;SACxF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA+H,EAAE,EAAE;YAC3K,OAAO,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,UAAU,UAAU,EAAE;gBACpE,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;aAC1B,CAAC,CAA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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const entenderTools = {
|
|
3
3
|
'service.get': {
|
|
4
|
-
description: '[Fase 2 — Entender] Obtiene las
|
|
4
|
+
description: '[Fase 2 — Entender] Obtiene las 8 dimensiones de un servicio: qué se entrega, quién lo entrega, quién lo recibe (con pagador separado), cuándo, dónde, ciclo de vida, evidencia requerida y cobro. Llama esto para entender completamente un servicio antes de comprometerse.',
|
|
5
5
|
schema: z.object({
|
|
6
6
|
service_id: z.string().describe('ID del servicio'),
|
|
7
7
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entender.js","sourceRoot":"","sources":["../../../src/tools/authenticated/entender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE;QACb,WAAW,EACT
|
|
1
|
+
{"version":3,"file":"entender.js","sourceRoot":"","sources":["../../../src/tools/authenticated/entender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE;QACb,WAAW,EACT,+QAA+Q;QACjR,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SACnD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA4B,EAAE,EAAE;YACxE,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC/D,CAAC;KACF;IAED,cAAc,EAAE;QACd,WAAW,EACT,kPAAkP;QACpP,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;SACrD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA4C,EAAE,EAAE;YACxF,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,UAAU,WAAW,EAAE;gBACpE,KAAK,EAAE,IAAI,CAAC,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
|
|
@@ -19,7 +19,7 @@ export declare const lifecycleTools: {
|
|
|
19
19
|
description: string;
|
|
20
20
|
schema: z.ZodObject<{
|
|
21
21
|
session_id: z.ZodString;
|
|
22
|
-
to_state: z.ZodEnum<["
|
|
22
|
+
to_state: z.ZodEnum<["scheduled", "confirmed", "in_progress", "delivered", "verified", "documented", "charged", "cancelled"]>;
|
|
23
23
|
actor: z.ZodObject<{
|
|
24
24
|
type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
|
|
25
25
|
id: z.ZodString;
|
|
@@ -60,7 +60,7 @@ export declare const lifecycleTools: {
|
|
|
60
60
|
} | undefined;
|
|
61
61
|
};
|
|
62
62
|
session_id: string;
|
|
63
|
-
to_state: "
|
|
63
|
+
to_state: "scheduled" | "confirmed" | "in_progress" | "delivered" | "verified" | "documented" | "charged" | "cancelled";
|
|
64
64
|
reason?: string | undefined;
|
|
65
65
|
evidence?: Record<string, unknown> | undefined;
|
|
66
66
|
}, {
|
|
@@ -73,7 +73,7 @@ export declare const lifecycleTools: {
|
|
|
73
73
|
} | undefined;
|
|
74
74
|
};
|
|
75
75
|
session_id: string;
|
|
76
|
-
to_state: "
|
|
76
|
+
to_state: "scheduled" | "confirmed" | "in_progress" | "delivered" | "verified" | "documented" | "charged" | "cancelled";
|
|
77
77
|
reason?: string | undefined;
|
|
78
78
|
evidence?: Record<string, unknown> | undefined;
|
|
79
79
|
}>;
|
|
@@ -11,12 +11,12 @@ export const lifecycleTools = {
|
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
'lifecycle.transition': {
|
|
14
|
-
description: '[Fase 4 — Ciclo de vida] Ejecuta una transición de estado en el ciclo de vida de una sesión. Transiciones válidas: requested→
|
|
14
|
+
description: '[Fase 4 — Ciclo de vida] Ejecuta una transición de estado en el ciclo de vida de una sesión. Transiciones válidas: requested→scheduled, scheduled→confirmed, confirmed→in_progress, in_progress→delivered, delivered→verified, verified→documented, documented→charged, any→cancelled. Cada transición puede requerir evidencia según el contrato del servicio.',
|
|
15
15
|
schema: z.object({
|
|
16
16
|
session_id: z.string().describe('ID de la sesión'),
|
|
17
17
|
to_state: z.enum([
|
|
18
|
-
'
|
|
19
|
-
'
|
|
18
|
+
'scheduled', 'confirmed', 'in_progress',
|
|
19
|
+
'delivered', 'verified', 'documented', 'charged', 'cancelled',
|
|
20
20
|
]).describe('Estado destino de la transición'),
|
|
21
21
|
actor: ActorSchema.describe('Quién ejecuta la transición'),
|
|
22
22
|
reason: z.string().optional().describe('Motivo de la transición (requerido para cancelled)'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../src/tools/authenticated/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,qBAAqB,EAAE;QACrB,WAAW,EACT,wMAAwM;QAC1M,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SACnD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA4B,EAAE,EAAE;YACxE,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,UAAU,YAAY,CAAC,CAAC;QACzE,CAAC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