@ingenx-io/valets-schema-mcp-server 0.2.2 → 0.2.4

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.
Files changed (72) hide show
  1. package/README.md +26 -0
  2. package/data/docs/collections/firestore-paths.md +15 -0
  3. package/data/docs/enums/attention-status.md +1 -1
  4. package/data/docs/enums/booking-status.md +1 -1
  5. package/data/docs/enums/customer-payment-status.md +1 -1
  6. package/data/docs/enums/customer-payment-target-type.md +1 -1
  7. package/data/docs/enums/delivery-type.md +1 -1
  8. package/data/docs/enums/deployment-link-type.md +1 -1
  9. package/data/docs/enums/event-status.md +1 -1
  10. package/data/docs/enums/fulfillment-status.md +1 -1
  11. package/data/docs/enums/loyalty-transaction-type.md +1 -1
  12. package/data/docs/enums/notification-channel.md +24 -0
  13. package/data/docs/enums/notification-entity-type.md +26 -0
  14. package/data/docs/enums/notification-status.md +23 -0
  15. package/data/docs/enums/order-status.md +2 -2
  16. package/data/docs/enums/outbound-message-format.md +2 -2
  17. package/data/docs/enums/outbound-message-purpose.md +2 -2
  18. package/data/docs/enums/outbound-message-status.md +2 -2
  19. package/data/docs/enums/payment-method.md +2 -2
  20. package/data/docs/enums/payment-proof-status.md +2 -2
  21. package/data/docs/enums/payment-status.md +2 -2
  22. package/data/docs/enums/pending-issue.md +2 -2
  23. package/data/docs/enums/return-status.md +2 -2
  24. package/data/docs/enums/session-status.md +2 -2
  25. package/data/docs/enums/site-status.md +2 -2
  26. package/data/docs/enums/stocktake-frequency.md +2 -2
  27. package/data/docs/enums/stocktake-item-status.md +2 -2
  28. package/data/docs/enums/stocktake-status.md +2 -2
  29. package/data/docs/enums/ticket-status.md +2 -2
  30. package/data/docs/enums/waba-label.md +2 -2
  31. package/data/docs/enums/whatsapp-button-sub-type.md +2 -2
  32. package/data/docs/enums/whatsapp-template-component.md +2 -2
  33. package/data/docs/enums/whatsapp-template-status.md +2 -2
  34. package/data/docs/index.md +6 -2
  35. package/data/docs/models/allowed-user.md +1 -1
  36. package/data/docs/models/analytics-backfill.md +1 -1
  37. package/data/docs/models/analytics-daily.md +1 -1
  38. package/data/docs/models/analytics-event.md +1 -1
  39. package/data/docs/models/analytics-hourly.md +1 -1
  40. package/data/docs/models/booking-version.md +1 -1
  41. package/data/docs/models/booking.md +1 -1
  42. package/data/docs/models/customer-payment-allocation.md +1 -1
  43. package/data/docs/models/customer-payment.md +1 -1
  44. package/data/docs/models/customer.md +1 -1
  45. package/data/docs/models/event.md +1 -1
  46. package/data/docs/models/loyalty-config.md +1 -1
  47. package/data/docs/models/loyalty-reward.md +1 -1
  48. package/data/docs/models/loyalty-status.md +1 -1
  49. package/data/docs/models/loyalty-transaction.md +1 -1
  50. package/data/docs/models/magic-link-request.md +1 -1
  51. package/data/docs/models/metrics-current.md +1 -1
  52. package/data/docs/models/metrics-daily.md +1 -1
  53. package/data/docs/models/metrics-monthly.md +1 -1
  54. package/data/docs/models/notification-record.md +619 -0
  55. package/data/docs/models/order-item.md +2 -2
  56. package/data/docs/models/order.md +2 -2
  57. package/data/docs/models/sale.md +2 -2
  58. package/data/docs/models/site-payment.md +2 -2
  59. package/data/docs/models/site.md +2 -2
  60. package/data/docs/models/stocktake-item.md +2 -2
  61. package/data/docs/models/stocktake.md +2 -2
  62. package/data/docs/models/ticket.md +2 -2
  63. package/data/docs/models/whatsapp-inbound-message.md +2 -2
  64. package/data/docs/models/whatsapp-outbound-lifecycle-event.md +2 -2
  65. package/data/docs/models/whatsapp-outbound-message.md +2 -2
  66. package/data/docs/models/whatsapp-template.md +2 -2
  67. package/data/static/cookbook.json +150 -0
  68. package/data/static/llms.txt +72 -0
  69. package/data/static/openapi.yaml +192 -0
  70. package/data/static/schemas.json +258 -1
  71. package/index.js +32 -0
  72. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "description": "@valets/schema \u2014 consolidated schema bundle",
4
- "generated": "2026-05-27T14:03:20.868899+00:00",
4
+ "generated": "2026-05-27T15:51:06.117627+00:00",
5
5
  "schemas": {
6
6
  "allowed-user": {
7
7
  "type": "object",
@@ -3477,6 +3477,263 @@
3477
3477
  "month": "month"
3478
3478
  }
3479
3479
  },
3480
+ "notification-channel": {
3481
+ "type": "string",
3482
+ "enum": [
3483
+ "email",
3484
+ "whatsapp",
3485
+ "sms",
3486
+ "push"
3487
+ ],
3488
+ "description": "Delivery channel of a NotificationRecord (GH#48)."
3489
+ },
3490
+ "notification-entity-type": {
3491
+ "type": "string",
3492
+ "enum": [
3493
+ "order",
3494
+ "booking",
3495
+ "customer",
3496
+ "digest",
3497
+ "magic_link",
3498
+ "other"
3499
+ ],
3500
+ "description": "Type of entity a NotificationRecord relates to. When `order`, the record is dual-written to the order-scoped subcollection (GH#48)."
3501
+ },
3502
+ "notification-record": {
3503
+ "type": "object",
3504
+ "properties": {
3505
+ "id": {
3506
+ "readOnly": true,
3507
+ "description": "(Read-only) Firestore document ID, auto-generated. Same ID is used in both the company-wide and order-scoped copies.",
3508
+ "type": [
3509
+ "string",
3510
+ "null"
3511
+ ]
3512
+ },
3513
+ "type": {
3514
+ "$ref": "#/definitions/notification-channel",
3515
+ "description": "(Read-only) Delivery channel.",
3516
+ "readOnly": true
3517
+ },
3518
+ "status": {
3519
+ "$ref": "#/definitions/notification-status",
3520
+ "description": "(Read-only) Delivery status after the send attempt.",
3521
+ "readOnly": true
3522
+ },
3523
+ "subject": {
3524
+ "readOnly": true,
3525
+ "description": "(Read-only) Subject line. Present for email notifications only.",
3526
+ "type": [
3527
+ "string",
3528
+ "null"
3529
+ ]
3530
+ },
3531
+ "recipients": {
3532
+ "type": "object",
3533
+ "properties": {
3534
+ "to": {
3535
+ "type": "array",
3536
+ "items": {
3537
+ "type": "object",
3538
+ "properties": {
3539
+ "email": {
3540
+ "description": "Recipient email address. Present for email notifications.",
3541
+ "type": "string"
3542
+ },
3543
+ "phone": {
3544
+ "description": "Recipient phone number (E.164). Present for whatsapp/sms notifications.",
3545
+ "type": "string"
3546
+ },
3547
+ "name": {
3548
+ "description": "Recipient display name.",
3549
+ "type": "string"
3550
+ },
3551
+ "role": {
3552
+ "description": "Recipient role (e.g. organizer, customer).",
3553
+ "type": "string"
3554
+ }
3555
+ },
3556
+ "additionalProperties": false,
3557
+ "description": "A notification recipient (GH#48)."
3558
+ },
3559
+ "description": "Primary recipients."
3560
+ },
3561
+ "cc": {
3562
+ "description": "CC recipients (email).",
3563
+ "type": "array",
3564
+ "items": {
3565
+ "type": "object",
3566
+ "properties": {
3567
+ "email": {
3568
+ "description": "Recipient email address. Present for email notifications.",
3569
+ "type": "string"
3570
+ },
3571
+ "phone": {
3572
+ "description": "Recipient phone number (E.164). Present for whatsapp/sms notifications.",
3573
+ "type": "string"
3574
+ },
3575
+ "name": {
3576
+ "description": "Recipient display name.",
3577
+ "type": "string"
3578
+ },
3579
+ "role": {
3580
+ "description": "Recipient role (e.g. organizer, customer).",
3581
+ "type": "string"
3582
+ }
3583
+ },
3584
+ "additionalProperties": false,
3585
+ "description": "A notification recipient (GH#48)."
3586
+ }
3587
+ },
3588
+ "bcc": {
3589
+ "description": "BCC recipients (email).",
3590
+ "type": "array",
3591
+ "items": {
3592
+ "type": "object",
3593
+ "properties": {
3594
+ "email": {
3595
+ "description": "Recipient email address. Present for email notifications.",
3596
+ "type": "string"
3597
+ },
3598
+ "phone": {
3599
+ "description": "Recipient phone number (E.164). Present for whatsapp/sms notifications.",
3600
+ "type": "string"
3601
+ },
3602
+ "name": {
3603
+ "description": "Recipient display name.",
3604
+ "type": "string"
3605
+ },
3606
+ "role": {
3607
+ "description": "Recipient role (e.g. organizer, customer).",
3608
+ "type": "string"
3609
+ }
3610
+ },
3611
+ "additionalProperties": false,
3612
+ "description": "A notification recipient (GH#48)."
3613
+ }
3614
+ }
3615
+ },
3616
+ "required": [
3617
+ "to"
3618
+ ],
3619
+ "additionalProperties": false,
3620
+ "readOnly": true,
3621
+ "description": "(Read-only) Recipients of the notification."
3622
+ },
3623
+ "relatedEntity": {
3624
+ "type": "object",
3625
+ "properties": {
3626
+ "type": {
3627
+ "$ref": "#/definitions/notification-entity-type",
3628
+ "description": "Entity type this notification relates to."
3629
+ },
3630
+ "id": {
3631
+ "type": "string",
3632
+ "description": "Entity document ID (e.g. orderId when type=order)."
3633
+ }
3634
+ },
3635
+ "required": [
3636
+ "type",
3637
+ "id"
3638
+ ],
3639
+ "additionalProperties": false,
3640
+ "readOnly": true,
3641
+ "description": "(Read-only) Entity that triggered the notification. type=order triggers the dual-write to the order subcollection."
3642
+ },
3643
+ "wamid": {
3644
+ "readOnly": true,
3645
+ "description": "(Read-only) WhatsApp message ID from the Meta API response. Present on successful whatsapp sends only.",
3646
+ "type": [
3647
+ "string",
3648
+ "null"
3649
+ ]
3650
+ },
3651
+ "templateParams": {
3652
+ "readOnly": true,
3653
+ "description": "(Read-only) Filled-in template variable values at send time. Allows reconstructing the sent message without fetching from Meta.",
3654
+ "type": [
3655
+ "object",
3656
+ "null"
3657
+ ],
3658
+ "propertyNames": {
3659
+ "type": "string"
3660
+ },
3661
+ "additionalProperties": {
3662
+ "type": "string"
3663
+ }
3664
+ },
3665
+ "metadata": {
3666
+ "readOnly": true,
3667
+ "description": "(Read-only) Channel-specific extras (e.g. senderPhoneId, templateName, orderNumber).",
3668
+ "type": [
3669
+ "object",
3670
+ "null"
3671
+ ],
3672
+ "propertyNames": {
3673
+ "type": "string"
3674
+ },
3675
+ "additionalProperties": {}
3676
+ },
3677
+ "error": {
3678
+ "readOnly": true,
3679
+ "description": "(Read-only) Failure reason. Present on status=failed.",
3680
+ "type": [
3681
+ "string",
3682
+ "null"
3683
+ ]
3684
+ },
3685
+ "sentAt": {
3686
+ "$ref": "#/definitions/firestore-timestamp",
3687
+ "description": "(Read-only) When the send was attempted.",
3688
+ "readOnly": true
3689
+ },
3690
+ "createdAt": {
3691
+ "$ref": "#/definitions/firestore-timestamp",
3692
+ "description": "(Read-only) When the record was created.",
3693
+ "readOnly": true
3694
+ }
3695
+ },
3696
+ "required": [
3697
+ "type",
3698
+ "status",
3699
+ "recipients",
3700
+ "relatedEntity",
3701
+ "sentAt",
3702
+ "createdAt"
3703
+ ],
3704
+ "additionalProperties": false,
3705
+ "description": "NotificationRecord \u2014 backend-written, multi-channel notification audit log (GH#48). Paths: companies/{cid}/notifications/{id} (always) and companies/{cid}/orders/{oid}/notifications/{id} (dual-write when relatedEntity.type=order). Consumers read only. Distinct from WhatsappOutboundMessage (GH#43).",
3706
+ "example": {
3707
+ "id": null,
3708
+ "type": "phone",
3709
+ "status": "status",
3710
+ "subject": null,
3711
+ "recipients": {
3712
+ "to": [
3713
+ {}
3714
+ ]
3715
+ },
3716
+ "relatedEntity": {
3717
+ "type": "phone",
3718
+ "id": "bk_abc123def456"
3719
+ },
3720
+ "wamid": null,
3721
+ "templateParams": null,
3722
+ "metadata": null,
3723
+ "error": null,
3724
+ "sentAt": "sentAt",
3725
+ "createdAt": "createdAt"
3726
+ }
3727
+ },
3728
+ "notification-status": {
3729
+ "type": "string",
3730
+ "enum": [
3731
+ "sent",
3732
+ "failed",
3733
+ "pending"
3734
+ ],
3735
+ "description": "Delivery status of a NotificationRecord, set by the Cloud Function after a send attempt (GH#48)."
3736
+ },
3480
3737
  "order": {
3481
3738
  "type": "object",
3482
3739
  "properties": {
package/index.js CHANGED
@@ -19,6 +19,7 @@
19
19
  * - list_decisions → all data model decisions with status
20
20
  * - get_decision → single decision detail
21
21
  * - get_openapi → OpenAPI 3.1 spec (full or single component)
22
+ * - get_guidance → use-case recipes (call sequences, field cheatsheets, workaround notes)
22
23
  *
23
24
  * Resources:
24
25
  * - valets://schemas.json → full schema bundle
@@ -103,6 +104,11 @@ async function loadOpenapi() {
103
104
  return fetchOrRead("/openapi.yaml", join(BUNDLED_STATIC, "openapi.yaml"));
104
105
  }
105
106
 
107
+ async function loadCookbook() {
108
+ const raw = await fetchOrRead("/cookbook.json", join(BUNDLED_STATIC, "cookbook.json"));
109
+ return JSON.parse(raw);
110
+ }
111
+
106
112
  // ---------------------------------------------------------------------------
107
113
  // Doc page loading (Markdown)
108
114
  // ---------------------------------------------------------------------------
@@ -319,6 +325,32 @@ server.tool(
319
325
  }
320
326
  );
321
327
 
328
+ server.tool(
329
+ "get_guidance",
330
+ "Get use-case recipes showing which MCP tools to call and in what order. Call with no arguments for an index of all recipes, or pass a slug to get the full recipe detail.",
331
+ { slug: z.string().optional().describe("Recipe slug (e.g. 'write-model-code', 'field-history', 'whatsapp-conversation-display'). Omit to list all recipes.") },
332
+ async ({ slug } = {}) => {
333
+ const cookbook = await loadCookbook();
334
+ if (!slug) {
335
+ const index = cookbook.recipes.map((r) => `- **${r.slug}**: ${r.summary}`).join("\n");
336
+ return {
337
+ content: [{ type: "text", text: `Available recipes (${cookbook.recipes.length}):\n\n${index}\n\nCall get_guidance with a slug to get the full recipe.` }],
338
+ };
339
+ }
340
+ const recipe = cookbook.recipes.find((r) => r.slug === slug);
341
+ if (!recipe) {
342
+ const available = cookbook.recipes.map((r) => r.slug);
343
+ return {
344
+ content: [{ type: "text", text: `Recipe "${slug}" not found.\n\nAvailable slugs:\n${available.map((s) => ` - ${s}`).join("\n")}` }],
345
+ isError: true,
346
+ };
347
+ }
348
+ return {
349
+ content: [{ type: "text", text: JSON.stringify(recipe, null, 2) }],
350
+ };
351
+ }
352
+ );
353
+
322
354
  // ---------------------------------------------------------------------------
323
355
  // Resources
324
356
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingenx-io/valets-schema-mcp-server",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "MCP server exposing @valets/schema documentation to AI agents",
5
5
  "type": "module",
6
6
  "main": "index.js",