@fourier-labs/harbour-contracts 0.98.0 → 0.100.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.
Files changed (29) hide show
  1. package/contract-release.json +24 -24
  2. package/dist/gen-ts/app-integrations-declaration.d.ts +60 -2
  3. package/dist/gen-ts/contract-release.d.ts +6 -6
  4. package/dist/gen-ts/contract-release.js +6 -6
  5. package/dist/gen-ts/data-grant-v2.d.ts +66 -16
  6. package/dist/gen-ts/integration-error-details.d.ts +1 -1
  7. package/dist/gen-ts/integration-execute-input-rules.d.ts +27 -0
  8. package/dist/gen-ts/integration-execute-input-rules.js +13 -0
  9. package/dist/gen-ts/integration-execute-request.d.ts +13 -3
  10. package/dist/gen-ts/integration-execute-result.d.ts +27 -0
  11. package/dist/gen-ts/integration-operations.d.ts +15 -0
  12. package/dist/gen-ts/integration-operations.js +19 -0
  13. package/dist/gen-ts/saas-connection.d.ts +6 -6
  14. package/gen-ts/app-integrations-declaration.ts +60 -2
  15. package/gen-ts/contract-release.ts +6 -6
  16. package/gen-ts/data-grant-v2.ts +69 -15
  17. package/gen-ts/integration-error-details.ts +11 -1
  18. package/gen-ts/integration-execute-input-rules.ts +13 -0
  19. package/gen-ts/integration-execute-request.ts +15 -3
  20. package/gen-ts/integration-execute-result.ts +29 -0
  21. package/gen-ts/integration-operations.ts +19 -0
  22. package/gen-ts/saas-connection.ts +9 -3
  23. package/package.json +1 -1
  24. package/schema/app-integrations-declaration.schema.json +233 -3
  25. package/schema/data-grant-v2.schema.json +77 -2
  26. package/schema/integration-error-details.schema.json +11 -1
  27. package/schema/integration-execute-request.schema.json +109 -2
  28. package/schema/integration-execute-result.schema.json +97 -0
  29. package/schema/saas-connection.schema.json +18 -3
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://schemas.harbour.dev/app-integrations-declaration.schema.json",
4
4
  "title": "AppIntegrationsDeclaration",
5
- "description": "Committed `.isomorph/integrations.json`: the app's declared use of tenant-wide integration connections. Keys are logical connection aliases (the governance sourceId); resources are logical names (Slack channel alias, warehouse view name), never IDs, tokens or URLs. The operation set is closed (eighty-one operations since 0.86.0, ADR 0018, ADR 0022, ADR 0024, ADR 0028, ADR 0029 and ADR 0032). Each operation carries a fixed identity mode — slack.dm.send=app, slack.user.lookup=app, every gmail.* operation=user, every basecamp.* operation=user, every sharepoint.* operation=user, every calendar.*, drive.*, docs.*, sheets.*, outlook.*, onedrive.*, excel.* and teams.* operation=user (0.86.0), warehouse.view.read=app, service.request=app — except the declared-mode Slack operations (slack.message.post, and since 0.71.0 slack.channel.history, slack.message.update and slack.message.delete), whose mode the app DECLARES: `app` acts as the company's Slack app (the one audited bot identity; a post goes out under the IT-approved per-app display name when the connection declares `presentation`), `user` acts as the signed-in person after their own consent (reads what they can read, edits what they wrote). The declared mode is the one the app requests access for; an app may hold approved grants for both modes after two requests, and each declared-mode call names which approved mode it runs under (`mode` on the execute request, 0.55.0) — a mode IT did not approve is refused, never swapped for the other. A `saas` connection may declare only the Slack, Gmail, Basecamp, SharePoint, phone, Google Workspace (calendar, drive, docs, sheets) and Microsoft 365 (outlook, onedrive, excel, teams) operations and a `database` connection only warehouse.view.read; `presentation` is a `saas` connection's optional per-app display name and icon for app-mode Slack posts, shown to IT at approval time and applied only from the approved grant. Gmail is user-mode only (reads, one send); its single resource is the fixed `inbox` alias. Basecamp (0.76.0, ADR 0022) is user-mode only too: basecamp.project.list runs on the fixed `account` alias (the company's pinned Basecamp account) and every other basecamp.* operation on a project alias IT mapped in the connection's `channels` map, so Basecamp itself refuses an id outside that project. SharePoint (0.78.0, ADR 0024) is user-mode only as well: every sharepoint.* operation runs on a site alias IT mapped in the connection's `channels` map (a Microsoft Graph site id), so Graph itself refuses a list, item or file outside that site. Google Workspace and Microsoft 365 (0.86.0, ADR 0032) are user-mode only too: every calendar.*, drive.*, docs.*, sheets.*, outlook.*, onedrive.* and excel.* operation runs on the provider's one fixed alias for the signed-in person's own data (governance resolves it, the way Gmail's is `inbox`; the contract does not pin the literal), and every teams.* operation on a channel alias IT mapped in the connection's `channels` map (a Teams team and channel id), so Graph itself refuses a message outside that channel. slack.dm.send and slack.user.lookup address people by email rather than a channel, so their single resource is the fixed `workspace` alias (the connection's installed workspace), the way Gmail's is `inbox`. This file also owns the shared IntegrationOperation / IntegrationIdentityMode / IntegrationEnvironment / IntegrationConnectionKind / IntegrationPresentation definitions referenced by the other integration schemas.",
5
+ "description": "Committed `.isomorph/integrations.json`: the app's declared use of tenant-wide integration connections. Keys are logical connection aliases (the governance sourceId); resources are logical names (Slack channel alias, warehouse view name), never IDs, tokens or URLs. The operation set is closed (eighty-one operations since 0.86.0, ADR 0018, ADR 0022, ADR 0024, ADR 0028, ADR 0029 and ADR 0032). Each operation carries a fixed identity mode — slack.dm.send=app, slack.user.lookup=app, every gmail.* operation=user, every basecamp.* operation=user, every sharepoint.* operation=user, every calendar.*, drive.*, docs.*, sheets.*, outlook.*, onedrive.*, excel.* and teams.* operation=user (0.86.0), warehouse.view.read=app, service.request=app — except the declared-mode Slack operations (slack.message.post, and since 0.71.0 slack.channel.history, slack.message.update and slack.message.delete), whose mode the app DECLARES: `app` acts as the company's Slack app (the one audited bot identity; a post goes out under the IT-approved per-app display name when the connection declares `presentation`), `user` acts as the signed-in person after their own consent (reads what they can read, edits what they wrote). The declared mode is the one the app requests access for; an app may hold approved grants for both modes after two requests, and each declared-mode call names which approved mode it runs under (`mode` on the execute request, 0.55.0) — a mode IT did not approve is refused, never swapped for the other. A `saas` connection may declare only the Slack, Gmail, Basecamp, SharePoint, phone, Google Workspace (calendar, drive, docs, sheets) and Microsoft 365 (outlook, onedrive, excel, teams) operations and a `database` connection only warehouse.view.read; `presentation` is a `saas` connection's optional per-app display name and icon for app-mode Slack posts, shown to IT at approval time and applied only from the approved grant. Gmail is user-mode only (reads, one send); its single resource is the fixed `inbox` alias. Basecamp (0.76.0, ADR 0022) is user-mode only too: basecamp.project.list runs on the fixed `account` alias (the company's pinned Basecamp account) and every other basecamp.* operation on a project alias IT mapped in the connection's `channels` map, so Basecamp itself refuses an id outside that project. SharePoint (0.78.0, ADR 0024) is user-mode only as well: every sharepoint.* operation runs on a site alias IT mapped in the connection's `channels` map (a Microsoft Graph site id), so Graph itself refuses a list, item or file outside that site. Google Workspace and Microsoft 365 (0.86.0, ADR 0032) are user-mode only too: every calendar.*, drive.*, docs.*, sheets.*, outlook.*, onedrive.* and excel.* operation runs on the provider's one fixed alias for the signed-in person's own data (governance resolves it, the way Gmail's is `inbox`; the contract does not pin the literal), and every teams.* operation on a channel alias IT mapped in the connection's `channels` map (a Teams team and channel id), so Graph itself refuses a message outside that channel. slack.dm.send and slack.user.lookup address people by email rather than a channel, so their single resource is the fixed `workspace` alias (the connection's installed workspace), the way Gmail's is `inbox`. This file also owns the shared IntegrationOperation / IntegrationIdentityMode / IntegrationEnvironment / IntegrationConnectionKind / IntegrationPresentation definitions referenced by the other integration schemas. Remote MCP connections add one generic user-only mcp.tool.call on server with exact accepted descriptors; an operation alone never authorizes every provider tool.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": [
@@ -47,7 +47,8 @@
47
47
  "enum": [
48
48
  "saas",
49
49
  "database",
50
- "service"
50
+ "service",
51
+ "mcp"
51
52
  ]
52
53
  },
53
54
  "IntegrationOperation": {
@@ -145,8 +146,10 @@
145
146
  "zohobooks.salesorder.list",
146
147
  "zohobooks.salesorder.read",
147
148
  "zohobooks.invoice.reviseDraft",
149
+ "zohobooks.invoice.markSent",
148
150
  "zohobooks.creditnote.create",
149
- "zohobooks.creditnote.read"
151
+ "zohobooks.creditnote.read",
152
+ "mcp.tool.call"
150
153
  ],
151
154
  "description": "Closed operation set. Extending it is a contracts change. 0.86.0 (ADR 0032) adds the forty-five Google Workspace and Microsoft 365 operations, every one user mode only: on the provider's fixed alias for the signed-in person's own data, calendar.calendar.list, calendar.event.list, calendar.event.read, calendar.event.create (a receipted write: explicit action, idempotencyKey), calendar.event.update and calendar.event.cancel (idempotent at Google, no key); drive.file.list, drive.file.search, drive.file.read, drive.file.upload and drive.folder.create (receipted writes); docs.document.read, docs.document.create (receipted), docs.document.append and docs.text.replace (no key); sheets.spreadsheet.read, sheets.values.read, sheets.values.append (receipted), sheets.values.update and sheets.values.clear (no key), sheets.spreadsheet.create (receipted); outlook.message.list, outlook.message.read, outlook.attachment.read, outlook.message.send and outlook.message.reply (receipted sends, as gmail.message.send), outlook.event.list, outlook.event.read, outlook.event.create (receipted), outlook.event.update and outlook.event.cancel (no key); onedrive.file.list, onedrive.file.search, onedrive.file.read, onedrive.file.upload and onedrive.folder.create (receipted); excel.worksheet.list, excel.range.read, excel.range.update (no key), excel.table.list, excel.row.add and excel.worksheet.add (receipted); and on a Teams channel alias (a key of the connection's `channels` map) teams.message.list, teams.message.post and teams.reply.post (receipted). 0.78.0 (ADR 0024) adds the nine SharePoint operations, every one user mode only on a site alias (a key of the connection's `channels` map, holding a Microsoft Graph site id): sharepoint.list.list, sharepoint.item.list, sharepoint.item.create (a receipted write: explicit action, idempotencyKey), sharepoint.item.update (a PATCH, idempotent at Graph, no key), sharepoint.drive.list, sharepoint.file.list, sharepoint.file.search, sharepoint.file.read and sharepoint.file.upload (a receipted write). 0.76.0 (ADR 0022) adds the eleven Basecamp operations, every one user mode only like gmail.*: basecamp.project.list (the projects of the company's pinned Basecamp account; its resource is the fixed `account` alias), and on one mapped project (the resource is a project alias, a key of the connection's `channels` map) basecamp.todolist.list, basecamp.todo.list, basecamp.todo.create (a receipted write: explicit action, idempotencyKey), basecamp.todo.complete (idempotent at Basecamp, no key), basecamp.message.list, basecamp.message.post, basecamp.comment.list, basecamp.comment.post, basecamp.campfire.post (the three posts are receipted writes) and basecamp.people.list. gmail.message.send (0.50.0) sends one email as the signed-in person: a send like slack.message.post (explicit Send, idempotencyKey, write receipt) under user identity; since 0.71.0 it may carry an HTML body and attachments. slack.message.post (0.53.0) runs in the mode the app declares: app (the company's Slack app, under the IT-approved per-app name) or user (the signed-in person, after their consent); since 0.55.0 each call names which of the approved modes it runs under. 0.71.0 (ADR 0018) adds slack.message.update and slack.message.delete (declared mode, like post), slack.dm.send (app mode: a direct message to 1..8 workspace members named by email), slack.user.lookup (app mode: email to Slack user id), gmail.thread.read (every message of one thread) and gmail.attachment.read (one attachment's bytes), and lets slack.channel.history run in app mode as well as user mode. 0.82.0 (ADR 0028) adds phone.sms.list (app mode only, a number alias from a phone connection's `channels` map: the SMS received on that number since a time) and warehouse.table.append (app mode only on a database connection, a receipted write with idempotencyKey: rows appended to a view alias whose mapping says `access: append`). 0.83.0 (ADR 0029) adds phone.number.get (app mode only, read-only, no input, on a number alias from a phone connection's `channels` map: the E.164 number that alias maps to, so the app — or a computer-use agent it drives — can type it into a portal that signs in by mobile number). 0.85.0 (ADR 0031) raises warehouse.table.append's `rows` from 1..500 to 1..5000 records (the byte cap stays governance's, now 8 MiB), so a downloaded report of a few thousand rows lands in one call."
152
155
  },
@@ -614,13 +617,22 @@
614
617
  "zohobooks.invoice.reviseDraft": {
615
618
  "$ref": "#/definitions/UserModeChannelOperation"
616
619
  },
620
+ "zohobooks.invoice.markSent": {
621
+ "$ref": "#/definitions/UserModeChannelOperation"
622
+ },
617
623
  "zohobooks.creditnote.create": {
618
624
  "$ref": "#/definitions/UserModeChannelOperation"
619
625
  },
620
626
  "zohobooks.creditnote.read": {
621
627
  "$ref": "#/definitions/UserModeChannelOperation"
628
+ },
629
+ "mcp.tool.call": {
630
+ "$ref": "#/definitions/McpUserOperation"
622
631
  }
623
632
  }
633
+ },
634
+ "mcp": {
635
+ "$ref": "#/definitions/McpToolSelection"
624
636
  }
625
637
  },
626
638
  "allOf": [
@@ -651,6 +663,11 @@
651
663
  "required": [
652
664
  "service.request"
653
665
  ]
666
+ },
667
+ {
668
+ "required": [
669
+ "mcp.tool.call"
670
+ ]
654
671
  }
655
672
  ]
656
673
  }
@@ -1121,6 +1138,11 @@
1121
1138
  "zohobooks.invoice.reviseDraft"
1122
1139
  ]
1123
1140
  },
1141
+ {
1142
+ "required": [
1143
+ "zohobooks.invoice.markSent"
1144
+ ]
1145
+ },
1124
1146
  {
1125
1147
  "required": [
1126
1148
  "zohobooks.creditnote.create"
@@ -1130,6 +1152,11 @@
1130
1152
  "required": [
1131
1153
  "zohobooks.creditnote.read"
1132
1154
  ]
1155
+ },
1156
+ {
1157
+ "required": [
1158
+ "mcp.tool.call"
1159
+ ]
1133
1160
  }
1134
1161
  ]
1135
1162
  }
@@ -1610,6 +1637,11 @@
1610
1637
  "zohobooks.invoice.reviseDraft"
1611
1638
  ]
1612
1639
  },
1640
+ {
1641
+ "required": [
1642
+ "zohobooks.invoice.markSent"
1643
+ ]
1644
+ },
1613
1645
  {
1614
1646
  "required": [
1615
1647
  "zohobooks.creditnote.create"
@@ -1619,6 +1651,11 @@
1619
1651
  "required": [
1620
1652
  "zohobooks.creditnote.read"
1621
1653
  ]
1654
+ },
1655
+ {
1656
+ "required": [
1657
+ "mcp.tool.call"
1658
+ ]
1622
1659
  }
1623
1660
  ]
1624
1661
  }
@@ -1630,6 +1667,35 @@
1630
1667
  ]
1631
1668
  }
1632
1669
  }
1670
+ },
1671
+ {
1672
+ "if": {
1673
+ "properties": {
1674
+ "kind": {
1675
+ "const": "mcp"
1676
+ }
1677
+ }
1678
+ },
1679
+ "then": {
1680
+ "required": [
1681
+ "mcp"
1682
+ ],
1683
+ "properties": {
1684
+ "presentation": false,
1685
+ "operations": {
1686
+ "propertyNames": {
1687
+ "enum": [
1688
+ "mcp.tool.call"
1689
+ ]
1690
+ }
1691
+ }
1692
+ }
1693
+ },
1694
+ "else": {
1695
+ "properties": {
1696
+ "mcp": false
1697
+ }
1698
+ }
1633
1699
  }
1634
1700
  ]
1635
1701
  },
@@ -1655,6 +1721,131 @@
1655
1721
  "maxItems": 1
1656
1722
  }
1657
1723
  }
1724
+ },
1725
+ "McpToolName": {
1726
+ "type": "string",
1727
+ "minLength": 1,
1728
+ "maxLength": 128,
1729
+ "description": "Opaque, case-sensitive provider tool name. Never interpreted as a source alias or endpoint."
1730
+ },
1731
+ "McpToolAnnotations": {
1732
+ "type": "object",
1733
+ "additionalProperties": false,
1734
+ "properties": {
1735
+ "title": {
1736
+ "type": "string",
1737
+ "maxLength": 256
1738
+ },
1739
+ "readOnlyHint": {
1740
+ "type": "boolean"
1741
+ },
1742
+ "destructiveHint": {
1743
+ "type": "boolean"
1744
+ },
1745
+ "idempotentHint": {
1746
+ "type": "boolean"
1747
+ },
1748
+ "openWorldHint": {
1749
+ "type": "boolean"
1750
+ }
1751
+ },
1752
+ "description": "Provider hints pinned with the accepted descriptor; never proof of authorization or safety."
1753
+ },
1754
+ "McpToolDescriptor": {
1755
+ "type": "object",
1756
+ "additionalProperties": false,
1757
+ "required": [
1758
+ "name",
1759
+ "inputSchema"
1760
+ ],
1761
+ "properties": {
1762
+ "name": {
1763
+ "$ref": "#/definitions/McpToolName"
1764
+ },
1765
+ "title": {
1766
+ "type": "string",
1767
+ "maxLength": 256
1768
+ },
1769
+ "description": {
1770
+ "type": "string",
1771
+ "maxLength": 16384
1772
+ },
1773
+ "inputSchema": {
1774
+ "type": "object",
1775
+ "additionalProperties": true
1776
+ },
1777
+ "outputSchema": {
1778
+ "type": "object",
1779
+ "additionalProperties": true
1780
+ },
1781
+ "annotations": {
1782
+ "$ref": "#/definitions/McpToolAnnotations"
1783
+ }
1784
+ },
1785
+ "description": "Accepted provider descriptor. MCP schema dialect validation, in-document references and 64 KiB serialized descriptor bound are runtime checks; no remote references are fetched."
1786
+ },
1787
+ "McpSelectedTool": {
1788
+ "type": "object",
1789
+ "additionalProperties": false,
1790
+ "required": [
1791
+ "name",
1792
+ "contractHash",
1793
+ "descriptor"
1794
+ ],
1795
+ "properties": {
1796
+ "name": {
1797
+ "$ref": "#/definitions/McpToolName"
1798
+ },
1799
+ "contractHash": {
1800
+ "type": "string",
1801
+ "pattern": "^sha256:[0-9a-f]{64}$"
1802
+ },
1803
+ "descriptor": {
1804
+ "$ref": "#/definitions/McpToolDescriptor"
1805
+ }
1806
+ },
1807
+ "description": "Runtime verifies name equals descriptor.name and hash is SHA256 of canonical {name,inputSchema,outputSchema?}; annotations and explanatory text are excluded."
1808
+ },
1809
+ "McpToolSelection": {
1810
+ "type": "object",
1811
+ "additionalProperties": false,
1812
+ "required": [
1813
+ "tools"
1814
+ ],
1815
+ "properties": {
1816
+ "tools": {
1817
+ "type": "array",
1818
+ "minItems": 1,
1819
+ "maxItems": 64,
1820
+ "items": {
1821
+ "$ref": "#/definitions/McpSelectedTool"
1822
+ }
1823
+ }
1824
+ },
1825
+ "description": "Exact accepted tool selection. Runtime rejects duplicate names and bounds all selected descriptors across the app to 128 KiB serialized."
1826
+ },
1827
+ "McpUserOperation": {
1828
+ "type": "object",
1829
+ "additionalProperties": false,
1830
+ "required": [
1831
+ "identity",
1832
+ "resources"
1833
+ ],
1834
+ "properties": {
1835
+ "identity": {
1836
+ "const": "user",
1837
+ "type": "string"
1838
+ },
1839
+ "resources": {
1840
+ "type": "array",
1841
+ "minItems": 1,
1842
+ "maxItems": 1,
1843
+ "items": {
1844
+ "type": "string",
1845
+ "const": "server"
1846
+ }
1847
+ }
1848
+ }
1658
1849
  }
1659
1850
  },
1660
1851
  "examples": [
@@ -2244,6 +2435,45 @@
2244
2435
  }
2245
2436
  }
2246
2437
  }
2438
+ },
2439
+ {
2440
+ "schema": "isomorph.app-integrations/2.0",
2441
+ "connections": {
2442
+ "fixture-mcp": {
2443
+ "kind": "mcp",
2444
+ "operations": {
2445
+ "mcp.tool.call": {
2446
+ "identity": "user",
2447
+ "resources": [
2448
+ "server"
2449
+ ]
2450
+ }
2451
+ },
2452
+ "mcp": {
2453
+ "tools": [
2454
+ {
2455
+ "name": "fixture.Read",
2456
+ "contractHash": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
2457
+ "descriptor": {
2458
+ "name": "fixture.Read",
2459
+ "inputSchema": {
2460
+ "type": "object",
2461
+ "properties": {
2462
+ "filter": {
2463
+ "type": "object"
2464
+ }
2465
+ },
2466
+ "additionalProperties": false
2467
+ },
2468
+ "annotations": {
2469
+ "readOnlyHint": true
2470
+ }
2471
+ }
2472
+ }
2473
+ ]
2474
+ }
2475
+ }
2476
+ }
2247
2477
  }
2248
2478
  ]
2249
2479
  }
@@ -17,7 +17,7 @@
17
17
  "status": { "$ref": "#/definitions/DataGrantV2Status" },
18
18
  "operations": {
19
19
  "type": "array",
20
- "maxItems": 91,
20
+ "maxItems": 92,
21
21
  "uniqueItems": true,
22
22
  "items": { "$ref": "app-integrations-declaration.schema.json#/definitions/IntegrationOperation" },
23
23
  "description": "Approved operations; each must match this grant's mode. Empty until the first approval. At most the seventy-eight SaaS operations (0.86.0: eleven Slack and Gmail, eleven Basecamp, nine SharePoint, two phone, forty-five Google Workspace and Microsoft 365); a database grant holds up to two (warehouse.view.read, warehouse.table.append)."
@@ -29,6 +29,7 @@
29
29
  "items": { "$ref": "#/definitions/IntegrationResource" },
30
30
  "description": "Approved logical resources. Never inherited by wildcard. Empty until the first approval."
31
31
  },
32
+ "mcp": {"$ref": "app-integrations-declaration.schema.json#/definitions/McpToolSelection"},
32
33
  "reviewedScope": { "$ref": "#/definitions/ReviewedIntegrationScope" },
33
34
  "expiresAt": { "type": "string", "format": "date-time", "description": "Absent only for explicitly approved ongoing production access." },
34
35
  "expiredAt": { "type": "string", "format": "date-time", "description": "Set by the recovery sweep once expiry has passed; enforcement itself is the UTC check on every call." },
@@ -65,7 +66,7 @@
65
66
  "description": "Only for SaaS grants mixing reviewed and automatic access: the previously human-reviewed scope. The remaining scope must satisfy current automatic rules. Homogeneous grants continue using approvedBy alone. Governance validates this is a subset of the grant; database behaviour is unchanged.",
66
67
  "properties": {
67
68
  "operations": {
68
- "type": "array", "maxItems": 91, "uniqueItems": true,
69
+ "type": "array", "maxItems": 92, "uniqueItems": true,
69
70
  "items": { "$ref": "app-integrations-declaration.schema.json#/definitions/IntegrationOperation" }
70
71
  },
71
72
  "resources": {
@@ -137,6 +138,80 @@
137
138
  }
138
139
  }
139
140
  },
141
+ "allOf": [
142
+ {
143
+ "if": {
144
+ "properties": {
145
+ "kind": {
146
+ "const": "mcp"
147
+ }
148
+ }
149
+ },
150
+ "then": {
151
+ "properties": {
152
+ "mode": {
153
+ "const": "user"
154
+ },
155
+ "operations": {
156
+ "items": {
157
+ "const": "mcp.tool.call"
158
+ }
159
+ },
160
+ "resources": {
161
+ "maxItems": 1,
162
+ "items": {
163
+ "type": "object",
164
+ "additionalProperties": false,
165
+ "required": [
166
+ "name"
167
+ ],
168
+ "properties": {
169
+ "name": {
170
+ "const": "server"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ },
176
+ "allOf": [
177
+ {
178
+ "if": {
179
+ "properties": {
180
+ "status": {
181
+ "const": "GRANTED"
182
+ }
183
+ }
184
+ },
185
+ "then": {
186
+ "required": [
187
+ "mcp"
188
+ ],
189
+ "properties": {
190
+ "operations": {
191
+ "minItems": 1
192
+ },
193
+ "resources": {
194
+ "minItems": 1
195
+ }
196
+ }
197
+ }
198
+ }
199
+ ]
200
+ },
201
+ "else": {
202
+ "properties": {
203
+ "mcp": false,
204
+ "operations": {
205
+ "not": {
206
+ "contains": {
207
+ "const": "mcp.tool.call"
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
214
+ ],
140
215
  "x-status-definition": "DataGrantV2Status",
141
216
  "x-terminal": ["DENIED", "REVOKED"],
142
217
  "x-transitions": [
@@ -63,7 +63,17 @@
63
63
  "UNAVAILABLE",
64
64
  "MODE_NOT_GRANTED",
65
65
  "MODE_REQUIRED",
66
- "SAMPLE_ROWS_NOT_ALLOWED"
66
+ "SAMPLE_ROWS_NOT_ALLOWED",
67
+ "CALL_IN_PROGRESS",
68
+ "CALL_OUTCOME_UNKNOWN",
69
+ "KEY_REUSED",
70
+ "MCP_TOOL_NOT_GRANTED",
71
+ "MCP_ARGUMENTS_INVALID",
72
+ "MCP_OUTPUT_INVALID",
73
+ "MCP_CONNECTION_FAILED",
74
+ "MCP_TOOL_ERROR",
75
+ "MCP_BUSY",
76
+ "MCP_OAUTH_SETUP_REQUIRED"
67
77
  ],
68
78
  "description": "Stable reason codes. SEND_OUTCOME_UNKNOWN: dispatch happened but the outcome is unknown; never re-post automatically. SEND_KEY_REUSED: the idempotency key was seen with a different payload or subject. GRANT_DENIED: IT denied the request. TOKEN_REFRESH_PENDING: another call holds the refresh lease; retry shortly. REQUEST_PENDING: a different request for this grant is still open. INPUT_INVALID: the operation input failed its bounds. IDEMPOTENCY_KEY_REQUIRED: a send without a UUID idempotencyKey. SEND_IN_PROGRESS: a retry arrived while the first send of that key is still running. CONNECTION_NOT_FOUND / APP_NOT_FOUND / GRANT_NOT_FOUND: the named record does not exist. AUTH_REQUIRED: no verified caller. UNAVAILABLE: the governance dependency (store, provider seam) is unreachable. MODE_NOT_GRANTED (403 FORBIDDEN, 0.55.0): a slack.message.post named a mode (app or user) IT has not approved for this app; the post is never served under the other mode. MODE_REQUIRED (400 VALIDATION_FAILED, 0.55.0): the app holds approved grants for both modes and the post named neither. SAMPLE_ROWS_NOT_ALLOWED (400 VALIDATION_FAILED, 0.74.0): an execute request carried sampleRows on any route but the development one. A sample value that does not parse as the column's recorded type is INPUT_INVALID, naming the column and the row."
69
79
  }
@@ -654,17 +654,25 @@
654
654
  }
655
655
  }
656
656
  }
657
+ },
658
+ "tool": {
659
+ "$ref": "app-integrations-declaration.schema.json#/definitions/McpToolName"
660
+ },
661
+ "arguments": {
662
+ "type": "object",
663
+ "additionalProperties": true,
664
+ "description": "Validated against the accepted tool inputSchema at runtime; arbitrary nested provider arguments are permitted only here."
657
665
  }
658
666
  }
659
667
  },
660
668
  "idempotencyKey": {
661
669
  "type": "string",
662
670
  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
663
- "description": "UUID of one explicit Send action; required for the sends (slack.message.post, slack.dm.send, gmail.message.send), the receipted Basecamp writes (basecamp.todo.create, basecamp.message.post, basecamp.comment.post, basecamp.campfire.post; 0.76.0) the receipted SharePoint writes (sharepoint.item.create, sharepoint.file.upload; 0.78.0) the receipted warehouse append (warehouse.table.append; 0.82.0, where it is also the BigQuery load job id) and the receipted Google Workspace and Microsoft 365 writes (0.86.0: calendar.event.create, drive.file.upload, drive.folder.create, docs.document.create, sheets.values.append, sheets.spreadsheet.create, outlook.message.send, outlook.message.reply, outlook.event.create, onedrive.file.upload, onedrive.folder.create, excel.row.add, excel.worksheet.add, teams.message.post, teams.reply.post), refused everywhere else. The same key with the same payload and subject returns the recorded outcome for seven days."
671
+ "description": "UUID of one explicit Send action; required for the sends (slack.message.post, slack.dm.send, gmail.message.send), the receipted Basecamp writes (basecamp.todo.create, basecamp.message.post, basecamp.comment.post, basecamp.campfire.post; 0.76.0) the receipted SharePoint writes (sharepoint.item.create, sharepoint.file.upload; 0.78.0) the receipted warehouse append (warehouse.table.append; 0.82.0, where it is also the BigQuery load job id) and the receipted Google Workspace and Microsoft 365 writes (0.86.0: calendar.event.create, drive.file.upload, drive.folder.create, docs.document.create, sheets.values.append, sheets.spreadsheet.create, outlook.message.send, outlook.message.reply, outlook.event.create, onedrive.file.upload, onedrive.folder.create, excel.row.add, excel.worksheet.add, teams.message.post, teams.reply.post), refused everywhere else. The same key with the same payload and subject returns the recorded outcome for seven days. MCP permits omission only for an accepted readOnlyHint=true descriptor; runtime requires the UUID for unknown/write tools."
664
672
  },
665
673
  "mode": {
666
674
  "$ref": "app-integrations-declaration.schema.json#/definitions/IntegrationIdentityMode",
667
- "description": "The declared-mode Slack operations only (slack.message.post since 0.55.0; slack.channel.history, slack.message.update and slack.message.delete since 0.71.0): which of the app's IT-approved modes this call runs under — app (the company's Slack app; a post goes out under the grant's per-app name and the footer) or user (the signed-in person, after their consent; no name, no footer). Required when the app holds approved grants for both modes (else MODE_REQUIRED); may be omitted when it holds one, which is then used. A named mode without an approved grant is refused with MODE_NOT_GRANTED; governance never falls back to the other mode. Every other operation's mode is fixed, so the field is refused there."
675
+ "description": "The declared-mode Slack operations only (slack.message.post since 0.55.0; slack.channel.history, slack.message.update and slack.message.delete since 0.71.0): which of the app's IT-approved modes this call runs under — app (the company's Slack app; a post goes out under the grant's per-app name and the footer) or user (the signed-in person, after their consent; no name, no footer). Required when the app holds approved grants for both modes (else MODE_REQUIRED); may be omitted when it holds one, which is then used. A named mode without an approved grant is refused with MODE_NOT_GRANTED; governance never falls back to the other mode. Every other operation's mode is fixed, so the field is refused there. MCP accepts explicit user only; shared app mode is deferred."
668
676
  },
669
677
  "sampleRows": {
670
678
  "type": "array",
@@ -3974,6 +3982,41 @@
3974
3982
  ]
3975
3983
  }
3976
3984
  },
3985
+ {
3986
+ "if": {
3987
+ "properties": {
3988
+ "operation": {
3989
+ "const": "zohobooks.invoice.markSent"
3990
+ }
3991
+ }
3992
+ },
3993
+ "then": {
3994
+ "x-read-only": false,
3995
+ "x-primary-identity": "user",
3996
+ "properties": {
3997
+ "mode": false,
3998
+ "input": {
3999
+ "propertyNames": {
4000
+ "enum": [
4001
+ "documentId"
4002
+ ]
4003
+ },
4004
+ "required": [
4005
+ "documentId"
4006
+ ],
4007
+ "properties": {
4008
+ "documentId": {
4009
+ "pattern": "^[0-9]{1,32}$",
4010
+ "maxLength": 32
4011
+ }
4012
+ }
4013
+ }
4014
+ },
4015
+ "required": [
4016
+ "idempotencyKey"
4017
+ ]
4018
+ }
4019
+ },
3977
4020
  {
3978
4021
  "if": {
3979
4022
  "properties": {
@@ -4075,6 +4118,43 @@
4075
4118
  ]
4076
4119
  }
4077
4120
  }
4121
+ },
4122
+ {
4123
+ "if": {
4124
+ "properties": {
4125
+ "operation": {
4126
+ "const": "mcp.tool.call"
4127
+ }
4128
+ }
4129
+ },
4130
+ "then": {
4131
+ "x-read-only": false,
4132
+ "x-runtime-idempotency": true,
4133
+ "x-primary-identity": "user",
4134
+ "required": [
4135
+ "resource"
4136
+ ],
4137
+ "properties": {
4138
+ "resource": {
4139
+ "const": "server"
4140
+ },
4141
+ "mode": {
4142
+ "const": "user"
4143
+ },
4144
+ "input": {
4145
+ "propertyNames": {
4146
+ "enum": [
4147
+ "tool",
4148
+ "arguments"
4149
+ ]
4150
+ },
4151
+ "required": [
4152
+ "tool",
4153
+ "arguments"
4154
+ ]
4155
+ }
4156
+ }
4157
+ }
4078
4158
  }
4079
4159
  ],
4080
4160
  "definitions": {
@@ -5460,6 +5540,15 @@
5460
5540
  },
5461
5541
  "idempotencyKey": "940e4390-ce19-4668-97f8-c5e963bb8662"
5462
5542
  },
5543
+ {
5544
+ "connection": "company-zohobooks",
5545
+ "resource": "organization",
5546
+ "operation": "zohobooks.invoice.markSent",
5547
+ "input": {
5548
+ "documentId": "123"
5549
+ },
5550
+ "idempotencyKey": "940e4390-ce19-4668-97f8-c5e963bb8662"
5551
+ },
5463
5552
  {
5464
5553
  "connection": "company-zohobooks",
5465
5554
  "resource": "organization",
@@ -5483,6 +5572,24 @@
5483
5572
  "input": {
5484
5573
  "documentId": "123"
5485
5574
  }
5575
+ },
5576
+ {
5577
+ "connection": "fixture-mcp",
5578
+ "operation": "mcp.tool.call",
5579
+ "resource": "server",
5580
+ "mode": "user",
5581
+ "input": {
5582
+ "tool": "fixture.Read",
5583
+ "arguments": {
5584
+ "filter": {
5585
+ "status": [
5586
+ "open",
5587
+ null,
5588
+ true
5589
+ ]
5590
+ }
5591
+ }
5592
+ }
5486
5593
  }
5487
5594
  ]
5488
5595
  }