@elastic.io/mcp 1.0.0-beta

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 (174) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +173 -0
  3. package/README.npm.md +173 -0
  4. package/dist/api/client.d.ts +12 -0
  5. package/dist/api/client.d.ts.map +1 -0
  6. package/dist/api/client.js +129 -0
  7. package/dist/api/client.js.map +1 -0
  8. package/dist/api/jsonapi.d.ts +21 -0
  9. package/dist/api/jsonapi.d.ts.map +1 -0
  10. package/dist/api/jsonapi.js +32 -0
  11. package/dist/api/jsonapi.js.map +1 -0
  12. package/dist/api/logger.d.ts +8 -0
  13. package/dist/api/logger.d.ts.map +1 -0
  14. package/dist/api/logger.js +43 -0
  15. package/dist/api/logger.js.map +1 -0
  16. package/dist/api/samples.d.ts +15 -0
  17. package/dist/api/samples.d.ts.map +1 -0
  18. package/dist/api/samples.js +465 -0
  19. package/dist/api/samples.js.map +1 -0
  20. package/dist/api/verification.d.ts +6 -0
  21. package/dist/api/verification.d.ts.map +1 -0
  22. package/dist/api/verification.js +71 -0
  23. package/dist/api/verification.js.map +1 -0
  24. package/dist/cli.d.ts +3 -0
  25. package/dist/cli.d.ts.map +1 -0
  26. package/dist/cli.js +9 -0
  27. package/dist/cli.js.map +1 -0
  28. package/dist/config.d.ts +15 -0
  29. package/dist/config.d.ts.map +1 -0
  30. package/dist/config.js +44 -0
  31. package/dist/config.js.map +1 -0
  32. package/dist/embeddings/factory.d.ts +7 -0
  33. package/dist/embeddings/factory.d.ts.map +1 -0
  34. package/dist/embeddings/factory.js +25 -0
  35. package/dist/embeddings/factory.js.map +1 -0
  36. package/dist/embeddings/google.d.ts +19 -0
  37. package/dist/embeddings/google.d.ts.map +1 -0
  38. package/dist/embeddings/google.js +132 -0
  39. package/dist/embeddings/google.js.map +1 -0
  40. package/dist/embeddings/types.d.ts +27 -0
  41. package/dist/embeddings/types.d.ts.map +1 -0
  42. package/dist/embeddings/types.js +2 -0
  43. package/dist/embeddings/types.js.map +1 -0
  44. package/dist/index.d.ts +3 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +227 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/paths.d.ts +2 -0
  49. package/dist/paths.d.ts.map +1 -0
  50. package/dist/paths.js +10 -0
  51. package/dist/paths.js.map +1 -0
  52. package/dist/server.d.ts +29 -0
  53. package/dist/server.d.ts.map +1 -0
  54. package/dist/server.js +385 -0
  55. package/dist/server.js.map +1 -0
  56. package/dist/setup.d.ts +3 -0
  57. package/dist/setup.d.ts.map +1 -0
  58. package/dist/setup.js +338 -0
  59. package/dist/setup.js.map +1 -0
  60. package/dist/tools/confirmation.d.ts +37 -0
  61. package/dist/tools/confirmation.d.ts.map +1 -0
  62. package/dist/tools/confirmation.js +120 -0
  63. package/dist/tools/confirmation.js.map +1 -0
  64. package/dist/tools/constants.d.ts +28 -0
  65. package/dist/tools/constants.d.ts.map +1 -0
  66. package/dist/tools/constants.js +92 -0
  67. package/dist/tools/constants.js.map +1 -0
  68. package/dist/tools/definitions.d.ts +3 -0
  69. package/dist/tools/definitions.d.ts.map +1 -0
  70. package/dist/tools/definitions.js +915 -0
  71. package/dist/tools/definitions.js.map +1 -0
  72. package/dist/tools/flow-build.d.ts +18 -0
  73. package/dist/tools/flow-build.d.ts.map +1 -0
  74. package/dist/tools/flow-build.js +295 -0
  75. package/dist/tools/flow-build.js.map +1 -0
  76. package/dist/tools/flow-evidence.d.ts +62 -0
  77. package/dist/tools/flow-evidence.d.ts.map +1 -0
  78. package/dist/tools/flow-evidence.js +128 -0
  79. package/dist/tools/flow-evidence.js.map +1 -0
  80. package/dist/tools/flow-state-machine.d.ts +69 -0
  81. package/dist/tools/flow-state-machine.d.ts.map +1 -0
  82. package/dist/tools/flow-state-machine.js +292 -0
  83. package/dist/tools/flow-state-machine.js.map +1 -0
  84. package/dist/tools/handlers/auth.d.ts +3 -0
  85. package/dist/tools/handlers/auth.d.ts.map +1 -0
  86. package/dist/tools/handlers/auth.js +410 -0
  87. package/dist/tools/handlers/auth.js.map +1 -0
  88. package/dist/tools/handlers/component.d.ts +3 -0
  89. package/dist/tools/handlers/component.d.ts.map +1 -0
  90. package/dist/tools/handlers/component.js +165 -0
  91. package/dist/tools/handlers/component.js.map +1 -0
  92. package/dist/tools/handlers/data-sample.d.ts +3 -0
  93. package/dist/tools/handlers/data-sample.d.ts.map +1 -0
  94. package/dist/tools/handlers/data-sample.js +83 -0
  95. package/dist/tools/handlers/data-sample.js.map +1 -0
  96. package/dist/tools/handlers/dynamic.d.ts +3 -0
  97. package/dist/tools/handlers/dynamic.d.ts.map +1 -0
  98. package/dist/tools/handlers/dynamic.js +139 -0
  99. package/dist/tools/handlers/dynamic.js.map +1 -0
  100. package/dist/tools/handlers/flow.d.ts +9 -0
  101. package/dist/tools/handlers/flow.d.ts.map +1 -0
  102. package/dist/tools/handlers/flow.js +427 -0
  103. package/dist/tools/handlers/flow.js.map +1 -0
  104. package/dist/tools/handlers/log.d.ts +3 -0
  105. package/dist/tools/handlers/log.d.ts.map +1 -0
  106. package/dist/tools/handlers/log.js +92 -0
  107. package/dist/tools/handlers/log.js.map +1 -0
  108. package/dist/tools/handlers/organization.d.ts +3 -0
  109. package/dist/tools/handlers/organization.d.ts.map +1 -0
  110. package/dist/tools/handlers/organization.js +39 -0
  111. package/dist/tools/handlers/organization.js.map +1 -0
  112. package/dist/tools/handlers/raw.d.ts +3 -0
  113. package/dist/tools/handlers/raw.d.ts.map +1 -0
  114. package/dist/tools/handlers/raw.js +80 -0
  115. package/dist/tools/handlers/raw.js.map +1 -0
  116. package/dist/tools/handlers/search.d.ts +3 -0
  117. package/dist/tools/handlers/search.d.ts.map +1 -0
  118. package/dist/tools/handlers/search.js +105 -0
  119. package/dist/tools/handlers/search.js.map +1 -0
  120. package/dist/tools/handlers/session.d.ts +3 -0
  121. package/dist/tools/handlers/session.d.ts.map +1 -0
  122. package/dist/tools/handlers/session.js +22 -0
  123. package/dist/tools/handlers/session.js.map +1 -0
  124. package/dist/tools/handlers.d.ts +12 -0
  125. package/dist/tools/handlers.d.ts.map +1 -0
  126. package/dist/tools/handlers.js +202 -0
  127. package/dist/tools/handlers.js.map +1 -0
  128. package/dist/tools/helpers.d.ts +44 -0
  129. package/dist/tools/helpers.d.ts.map +1 -0
  130. package/dist/tools/helpers.js +195 -0
  131. package/dist/tools/helpers.js.map +1 -0
  132. package/dist/tools/types.d.ts +39 -0
  133. package/dist/tools/types.d.ts.map +1 -0
  134. package/dist/tools/types.js +2 -0
  135. package/dist/tools/types.js.map +1 -0
  136. package/dist/tools/validation.d.ts +35 -0
  137. package/dist/tools/validation.d.ts.map +1 -0
  138. package/dist/tools/validation.js +800 -0
  139. package/dist/tools/validation.js.map +1 -0
  140. package/dist/types/index.d.ts +47 -0
  141. package/dist/types/index.d.ts.map +1 -0
  142. package/dist/types/index.js +2 -0
  143. package/dist/types/index.js.map +1 -0
  144. package/dist/vectorstore/factory.d.ts +7 -0
  145. package/dist/vectorstore/factory.d.ts.map +1 -0
  146. package/dist/vectorstore/factory.js +25 -0
  147. package/dist/vectorstore/factory.js.map +1 -0
  148. package/dist/vectorstore/qdrant.d.ts +11 -0
  149. package/dist/vectorstore/qdrant.d.ts.map +1 -0
  150. package/dist/vectorstore/qdrant.js +107 -0
  151. package/dist/vectorstore/qdrant.js.map +1 -0
  152. package/dist/vectorstore/types.d.ts +28 -0
  153. package/dist/vectorstore/types.d.ts.map +1 -0
  154. package/dist/vectorstore/types.js +2 -0
  155. package/dist/vectorstore/types.js.map +1 -0
  156. package/package.json +66 -0
  157. package/resources/docs/flow-building-guide.md +581 -0
  158. package/resources/docs/rest-api-pagination.md +58 -0
  159. package/resources/docs/standardized-components-guide.md +66 -0
  160. package/resources/docs/system-instructions.md +207 -0
  161. package/resources/flow-examples/batch-flow-1-collect.json +51 -0
  162. package/resources/flow-examples/batch-flow-2-process.json +70 -0
  163. package/resources/flow-examples/code-component-transform.json +65 -0
  164. package/resources/flow-examples/code-component-trigger.json +52 -0
  165. package/resources/flow-examples/code-component-with-credentials-trigger.json +53 -0
  166. package/resources/flow-examples/code-component-with-credentials.json +67 -0
  167. package/resources/flow-examples/filter-step.json +63 -0
  168. package/resources/flow-examples/polling-sync-trigger.json +50 -0
  169. package/resources/flow-examples/router-branching.json +94 -0
  170. package/resources/flow-examples/splitter-re-assemble.json +72 -0
  171. package/resources/flow-examples/splitter-split.json +68 -0
  172. package/resources/flow-examples/timer-query-action-sync.json +68 -0
  173. package/resources/flow-examples/webhook-async-sync.json +49 -0
  174. package/resources/flow-examples/webhook-request-reply.json +63 -0
@@ -0,0 +1,915 @@
1
+ import { withConfirmationSchemas, DESTRUCTIVE_TOOL_NAMES } from './confirmation.js';
2
+ const TOOL_DEFS = [
3
+ {
4
+ name: DESTRUCTIVE_TOOL_NAMES.CREATE_AUTH_CLIENT,
5
+ description: 'Register a new Authentication Client (oauth2, basic, api_key, noauth) for a component. For basic, api_key, and noauth types, credentials is typically an empty object {} and is created with global scope by default (no contract/tenant/workspace relationship).\n\nPreconditions: You MUST have called get_component for this componentId first to inspect the descriptor and determine the correct auth type. Do NOT guess the auth type.\nPostconditions: Returns the created auth client with its ID. Use this ID when creating secrets via create_secret.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {
9
+ componentId: {
10
+ type: 'string',
11
+ description: 'The unique ID of the component.'
12
+ },
13
+ name: {
14
+ type: 'string',
15
+ description: 'The name of the authentication client.'
16
+ },
17
+ type: {
18
+ type: 'string',
19
+ enum: ['oauth2', 'basic', 'api_key', 'noauth'],
20
+ description: 'The type of authentication client.'
21
+ },
22
+ workspaceId: {
23
+ type: 'string',
24
+ description: 'Optional. Workspace ID scope for the client. If contractId, tenantId, and workspaceId are all omitted, the client visibility will be global.'
25
+ },
26
+ contractId: {
27
+ type: 'string',
28
+ description: 'Optional. Contract ID scope for the client.'
29
+ },
30
+ tenantId: {
31
+ type: 'string',
32
+ description: 'Optional. Tenant ID scope for the client.'
33
+ },
34
+ credentials: {
35
+ type: 'object',
36
+ description: 'Optional client credentials block. Defaults to {} for basic, api_key, and noauth. For oauth2, must contain client_id, client_secret, refresh_token_uri, token_uri, and auth_uri.'
37
+ }
38
+ },
39
+ required: ['componentId', 'name', 'type']
40
+ }
41
+ },
42
+ {
43
+ name: DESTRUCTIVE_TOOL_NAMES.CREATE_CREDENTIALS,
44
+ description: 'Create credentials or a secret connection (along with its authentication client) for a component in a workspace based on its authorization type. If it uses secrets (basic, api_key, noauth), the client is created with global visibility and credentials: {} by default, while oauth2 client is created workspace-scoped.\n\nPreconditions: You MUST have called get_component for this componentId to inspect the descriptor and determine the correct auth type (secrets vs plain credentials). You MUST have called list_credentials and list_secrets to verify no existing credentials can be reused.\nPostconditions: Returns the created credential/secret ID. Use this ID in the flow node\'s credentials_id or secret_id field.',
45
+ inputSchema: {
46
+ type: 'object',
47
+ properties: {
48
+ workspaceId: {
49
+ type: 'string',
50
+ description: 'The workspace ID.'
51
+ },
52
+ componentId: {
53
+ type: 'string',
54
+ description: 'The component ID.'
55
+ },
56
+ name: {
57
+ type: 'string',
58
+ description: 'Optional name for the credential, secret, or auth client to be created.'
59
+ },
60
+ authClientId: {
61
+ type: 'string',
62
+ description: 'Optional existing auth client ID to reuse if the component uses secrets.'
63
+ },
64
+ clientConfig: {
65
+ type: 'object',
66
+ description: 'Optional client configuration for creating a new auth client. Fields: {name, type, credentials, scope, workspaceId, contractId, tenantId}. Defaults to global scope and empty credentials for basic/api_key/noauth. Example for oauth2: {"type": "oauth2", "credentials": {"client_id": "...", "client_secret": "...", "auth_uri": "...", "token_uri": "..."}}'
67
+ },
68
+ secretConfig: {
69
+ type: 'object',
70
+ description: 'Optional secret configuration for creating a secret. Fields: {name, type, credentials}. Example credentials properties per type:\n- oauth2: {"access_token": "...", "refresh_token": "..."}\n- basic: {"username": "...", "password": "..."}\n- api_key: {"headerName": "...", "headerValue": "..."}\n- noauth: {}'
71
+ },
72
+ credentialConfig: {
73
+ type: 'object',
74
+ description: 'Optional credential configuration for creating plain credentials. Fields: {name, keys}. "keys" contains the flat key-value pairs defined in the component descriptor fields schema. Example: {"keys": {"apiKey": "my-key"}}'
75
+ }
76
+ },
77
+ required: ['workspaceId', 'componentId']
78
+ }
79
+ },
80
+ {
81
+ name: DESTRUCTIVE_TOOL_NAMES.CREATE_FLOW,
82
+ description: 'Create a new integration flow. The body of the request must be fully constructed as a valid JSON API payload containing type: "flow", attributes (name, type, graph), and relationships (workspace). CRITICAL: All edges with mappers MUST follow the JSONata mapping rules (use $getPassthrough().step_id.body.field for variables, and use double quotes (escaped as \\") for literals without wrapping the entire expression in outer quotes).\n\nPreconditions:\n1. You MUST have read the resource elasticio://docs/flow-building-guide in this session.\n2. You MUST have called get_component for EVERY component used in the flow.\n3. You MUST have called list_credentials/list_secrets for EVERY component that requires auth.\n4. You MUST have called init_dynamic_metadata for EVERY step with dynamicMetadata:true to retrieve BOTH input AND output schemas. Mapper keys come from the TARGET step\'s input schema; mapper values MUST use real field names from the SOURCE step\'s output schema — NEVER guess field names.\n5. You MUST have presented a summary of all steps to the user and received confirmation.\nPostconditions: Returns the created flow with its ID. The flow is created in INACTIVE state. Call start_flow to activate it.',
83
+ inputSchema: {
84
+ type: 'object',
85
+ properties: {
86
+ body: {
87
+ type: 'object',
88
+ description: 'The JSON API compliant request body payload.'
89
+ }
90
+ },
91
+ required: ['body']
92
+ }
93
+ },
94
+ {
95
+ name: DESTRUCTIVE_TOOL_NAMES.CREATE_SECRET,
96
+ description: 'Create a new Authentication Secret (auth-secret) inside a specific workspace linked to an auth client.\n\nPreconditions: You MUST have a valid authClientId from a previous create_auth_client call or from list_auth_clients. You MUST have called get_component to determine the correct secret type and required credential fields.\nPostconditions: Returns the created secret with its ID. Use this secret_id in flow nodes that require authentication.',
97
+ inputSchema: {
98
+ type: 'object',
99
+ properties: {
100
+ workspaceId: {
101
+ type: 'string',
102
+ description: 'The unique workspace ID.'
103
+ },
104
+ name: {
105
+ type: 'string',
106
+ description: 'The name of the authentication secret.'
107
+ },
108
+ type: {
109
+ type: 'string',
110
+ enum: ['oauth2', 'basic', 'api_key', 'noauth'],
111
+ description: 'The sub-type of authentication secret.'
112
+ },
113
+ authClientId: {
114
+ type: 'string',
115
+ description: 'The unique ID of the auth client this secret uses.'
116
+ },
117
+ credentials: {
118
+ type: 'object',
119
+ description: 'The secret credentials block (an empty "fields": {} object and "state": "ready" are automatically injected). Example configurations per type:\n- oauth2: {"access_token": "...", "expires_in": 3599, "refresh_token": "...", "scope": "...", "additional_params": "..."}\n- basic: {"username": "...", "password": "..."}\n- api_key: {"headerName": "...", "headerValue": "..."}\n- noauth: {}'
120
+ }
121
+ },
122
+ required: ['workspaceId', 'name', 'type', 'authClientId', 'credentials']
123
+ }
124
+ },
125
+ {
126
+ name: DESTRUCTIVE_TOOL_NAMES.EXECUTE_RAW_API_REQUEST,
127
+ description: 'Execute a raw HTTP request against the elastic.io REST API. Intended as a fallback or escape hatch: (1) for edge-case endpoints not covered by dedicated tools, or (2) when dedicated tools fail, error out, or are blocked by platform/validation limitations.\n\nPreconditions: Always prefer dedicated tools (e.g. list_flows, get_flow, update_flow_draft, list_workspaces, etc.) first for standard operations. Only fall back to this tool if no dedicated tool exists or if the dedicated tool fails/cannot complete the operation. Verify the endpoint path and payload format against the API documentation at https://api.elastic.io/docs/v2 first.\nPostconditions: Returns the raw API response. GET requests do not require confirmation; mutating methods (POST, PUT, PATCH, DELETE) require confirmed: true.',
128
+ inputSchema: {
129
+ type: 'object',
130
+ properties: {
131
+ method: {
132
+ type: 'string',
133
+ enum: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'],
134
+ description: 'The HTTP request method.'
135
+ },
136
+ path: {
137
+ type: 'string',
138
+ description: 'The API endpoint path (e.g. /workspaces or /flows/123/steps).'
139
+ },
140
+ body: {
141
+ type: 'object',
142
+ description: 'The optional request body payload.'
143
+ }
144
+ },
145
+ required: ['method', 'path']
146
+ }
147
+ },
148
+ {
149
+ name: 'get_auth_client',
150
+ description: 'Retrieve details for a specific authentication client by its ID. To specify the scope of the request, you must provide one of workspaceId, contractId, or tenantId as a parameter (unless retrieving a global client).',
151
+ inputSchema: {
152
+ type: 'object',
153
+ properties: {
154
+ authClientId: {
155
+ type: 'string',
156
+ description: 'The unique identifier of the auth client.'
157
+ },
158
+ workspaceId: {
159
+ type: 'string',
160
+ description: 'Optional. Scopes the request to the given workspace. Only one of workspaceId, contractId, or tenantId should be specified.'
161
+ },
162
+ contractId: {
163
+ type: 'string',
164
+ description: 'Optional. Scopes the request to the given contract.'
165
+ },
166
+ tenantId: {
167
+ type: 'string',
168
+ description: 'Optional. Scopes the request to the given tenant.'
169
+ }
170
+ },
171
+ required: ['authClientId']
172
+ }
173
+ },
174
+ {
175
+ name: 'get_component',
176
+ description: 'Retrieve the official technical definition of a specific component by its ID, including its available actions, triggers, settings, fields, and JSON input/output schema structures. This is the primary tool to discover component schemas and actions when building a new flow or step. Note that the schemas retrieved here describe what fields are configured and mapped on the UI, not the REST API payload graph representation directly.\n\nPreconditions: You MUST have obtained the componentId from list_components first. Do NOT guess or hardcode component IDs.\nPostconditions: After calling this tool, you MUST present the available actions/triggers to the user and ask which one to use. Do NOT choose an action/trigger without user confirmation. The response also provides commandPrefix and latestVersionId needed for building the flow node\'s command string.',
177
+ inputSchema: {
178
+ type: 'object',
179
+ properties: {
180
+ componentId: {
181
+ type: 'string',
182
+ description: 'The unique identifier of the component (e.g. aaa1111111bbb2222222ccc08).'
183
+ },
184
+ actionOrTriggerId: {
185
+ type: 'string',
186
+ description: 'Optional action or trigger ID to filter and return only that specific action or trigger schema, preventing token bloat.'
187
+ }
188
+ },
189
+ required: ['componentId']
190
+ }
191
+ },
192
+ {
193
+ name: 'get_credential',
194
+ description: 'Retrieve detailed configuration and metadata for a specific credential connection by its ID.',
195
+ inputSchema: {
196
+ type: 'object',
197
+ properties: {
198
+ credentialId: {
199
+ type: 'string',
200
+ description: 'The unique identifier of the credential connection.'
201
+ }
202
+ },
203
+ required: ['credentialId']
204
+ }
205
+ },
206
+ {
207
+ name: 'get_flow',
208
+ description: 'Get the detailed configuration, steps, and structure of a specific integration flow.\n\nPreconditions: You MUST have obtained the flowId from list_flows or from the user.\nPostconditions: The flow is marked as "inspected" in the session. This is a prerequisite for update_flow and update_flow_draft (Playbook B).',
209
+ inputSchema: {
210
+ type: 'object',
211
+ properties: {
212
+ flowId: {
213
+ type: 'string',
214
+ description: 'The unique identifier of the integration flow.'
215
+ },
216
+ include: {
217
+ type: 'string',
218
+ enum: ['flow-containers', 'descriptor'],
219
+ description: 'Optional related resources to include: "flow-containers" or "descriptor".'
220
+ }
221
+ },
222
+ required: ['flowId']
223
+ }
224
+ },
225
+ {
226
+ name: 'get_flow_draft',
227
+ description: 'Retrieve the current unpublished draft version of an integration flow.',
228
+ inputSchema: {
229
+ type: 'object',
230
+ properties: {
231
+ flowId: {
232
+ type: 'string',
233
+ description: 'The unique identifier of the flow.'
234
+ }
235
+ },
236
+ required: ['flowId']
237
+ }
238
+ },
239
+ {
240
+ name: 'get_logs',
241
+ description: 'Retrieve execution logs for integration flows, filtered and formatted token-safely. Returns a `summary` object with `time_range`, `overall_levels` (count by level), and `per_step` (per step_id: component_name, method, total, by_level counts, first_error). Use the summary to present a structured Execution Analysis, then follow Playbook C to ask the user whether they want fixes applied or a full assessment with improvement suggestions.',
242
+ inputSchema: {
243
+ type: 'object',
244
+ properties: {
245
+ workspaceId: {
246
+ type: 'string',
247
+ description: 'The unique identifier of the workspace.'
248
+ },
249
+ flowIds: {
250
+ type: 'array',
251
+ items: {
252
+ type: 'string'
253
+ },
254
+ description: 'Optional array of flow IDs to filter logs.'
255
+ },
256
+ from: {
257
+ type: 'string',
258
+ description: 'Optional start date of the period (ISO 8601 format).'
259
+ },
260
+ to: {
261
+ type: 'string',
262
+ description: 'Optional end date of the period (ISO 8601 format).'
263
+ },
264
+ search: {
265
+ type: 'string',
266
+ description: 'Optional search term to filter log messages.'
267
+ },
268
+ offset: {
269
+ type: 'number',
270
+ description: 'Optional number of items to skip from the beginning. Default is 0.'
271
+ },
272
+ limit: {
273
+ type: 'number',
274
+ description: 'Optional number of items to return. Default is 50.',
275
+ default: 50
276
+ },
277
+ levels: {
278
+ type: 'array',
279
+ items: {
280
+ type: 'number',
281
+ enum: [1, 10, 20, 30, 40, 50, 60]
282
+ },
283
+ description: 'Optional log levels (1-None, 10-trace, 20-debug, 30-info, 40-warn, 50-error, 60-fatal).'
284
+ },
285
+ containerId: {
286
+ type: 'string',
287
+ description: 'Optional container identifier.'
288
+ }
289
+ },
290
+ required: ['workspaceId']
291
+ }
292
+ },
293
+ {
294
+ name: 'get_scheduled_execution_result',
295
+ description: 'Retrieve the result of a dynamic select model, metadata, or credential verification execution. Optionally polls internally if the execution is still pending.',
296
+ inputSchema: {
297
+ type: 'object',
298
+ properties: {
299
+ executionId: {
300
+ type: 'string',
301
+ description: 'The unique identifier of the execution task.'
302
+ },
303
+ poll: {
304
+ type: 'boolean',
305
+ description: 'Optional. If true, the server polls internally for up to 15 seconds before returning. Defaults to true.',
306
+ default: true
307
+ }
308
+ },
309
+ required: ['executionId']
310
+ }
311
+ },
312
+ {
313
+ name: 'get_secret',
314
+ description: 'Retrieve detailed configuration and metadata for a specific authentication secret by its ID and workspace ID.',
315
+ inputSchema: {
316
+ type: 'object',
317
+ properties: {
318
+ workspaceId: {
319
+ type: 'string',
320
+ description: 'The unique identifier of the workspace.'
321
+ },
322
+ secretId: {
323
+ type: 'string',
324
+ description: 'The unique identifier of the secret.'
325
+ }
326
+ },
327
+ required: ['workspaceId', 'secretId']
328
+ }
329
+ },
330
+ {
331
+ name: 'init_dynamic_metadata',
332
+ description: 'Initiate a dynamic metadata schema retrieval for a component action or trigger when the action/trigger definition in the component descriptor has "dynamicMetadata": true. Do NOT use this tool if dynamicMetadata is not true. Returns an executionId that must be polled using get_scheduled_execution_result.\n\nThe result contains BOTH input ("in") and output ("out") schemas:\n- "in" schema: defines what fields the step EXPECTS as input (used as mapper KEYS on the incoming edge)\n- "out" schema: defines what fields the step EMITS as output (used as mapper VALUES on outgoing edges via $getPassthrough().step_id.body.<field>)\n\nIMPORTANT: You MUST call this tool for BOTH the source step (to get its output schema) AND the target step (to get its input schema) when building edge mappers. Do NOT guess or hallucinate output field names — always retrieve the real output schema.\n\nPreconditions: You MUST have called get_component and verified that the action/trigger has "dynamicMetadata": true. You MUST have a valid credentialId or secretId. You MUST have resolved all preceding dependent fields (e.g., selected the object type via init_dynamic_select_model first).\nPostconditions: Returns an executionId. You MUST call get_scheduled_execution_result with this executionId to get the actual schema. If status is "pending", wait 2-3 seconds and poll again.',
333
+ inputSchema: {
334
+ type: 'object',
335
+ properties: {
336
+ workspaceId: {
337
+ type: 'string',
338
+ description: 'The unique identifier of the workspace.'
339
+ },
340
+ componentId: {
341
+ type: 'string',
342
+ description: 'The unique identifier of the component.'
343
+ },
344
+ versionId: {
345
+ type: 'string',
346
+ description: 'Optional. The component version ID (Git revision). Defaults to "latest".',
347
+ default: 'latest'
348
+ },
349
+ actionOrTriggerName: {
350
+ type: 'string',
351
+ description: 'The name (ID string) of the action or trigger (mapped to the "module" field in the API payload).'
352
+ },
353
+ credentialId: {
354
+ type: 'string',
355
+ description: 'Optional. The credential ID to authorize the call. Either credentialId or secretId must be provided.'
356
+ },
357
+ secretId: {
358
+ type: 'string',
359
+ description: 'Optional. The secret ID to authorize the call. Either credentialId or secretId must be provided.'
360
+ },
361
+ fields: {
362
+ type: 'object',
363
+ description: 'Optional. Preceding field configurations/values that the dynamic metadata retrieval depends on.'
364
+ }
365
+ },
366
+ required: ['workspaceId', 'componentId', 'actionOrTriggerName']
367
+ }
368
+ },
369
+ {
370
+ name: 'init_dynamic_select_model',
371
+ description: 'Initiate a dynamic select model (dropdown list) retrieval for a component field when the field\'s model property in the component descriptor is a string (representing a dynamic model function). Do NOT use this tool for static fields where the model is a JSON object (whose options should be taken directly from the descriptor). Returns an executionId that must be polled using get_scheduled_execution_result.\n\nPreconditions: You MUST have called get_component and verified that the field\'s model property is a string (dynamic), not a JSON object (static). You MUST have a valid credentialId or secretId.\nPostconditions: Returns an executionId. You MUST call get_scheduled_execution_result with this executionId. Then you MUST present the dropdown options to the user and let them choose — do NOT select an option automatically.',
372
+ inputSchema: {
373
+ type: 'object',
374
+ properties: {
375
+ workspaceId: {
376
+ type: 'string',
377
+ description: 'The unique identifier of the workspace.'
378
+ },
379
+ componentId: {
380
+ type: 'string',
381
+ description: 'The unique identifier of the component.'
382
+ },
383
+ versionId: {
384
+ type: 'string',
385
+ description: 'Optional. The component version ID (Git revision). Defaults to "latest".',
386
+ default: 'latest'
387
+ },
388
+ actionOrTriggerName: {
389
+ type: 'string',
390
+ description: 'The name (ID string) of the action or trigger.'
391
+ },
392
+ methodName: {
393
+ type: 'string',
394
+ description: 'The method name (function to call, retrieved from the descriptor\'s model property).'
395
+ },
396
+ credentialId: {
397
+ type: 'string',
398
+ description: 'Optional. The credential ID to authorize the call. Either credentialId or secretId must be provided.'
399
+ },
400
+ secretId: {
401
+ type: 'string',
402
+ description: 'Optional. The secret ID to authorize the call. Either credentialId or secretId must be provided.'
403
+ },
404
+ fields: {
405
+ type: 'object',
406
+ description: 'Optional. Preceding field configurations/values that the dynamic field depends on.'
407
+ }
408
+ },
409
+ required: ['workspaceId', 'componentId', 'actionOrTriggerName', 'methodName']
410
+ }
411
+ },
412
+ {
413
+ name: 'init_verify_credentials',
414
+ description: 'Initiate a credential verification request for a component. The verification process is asynchronous; this tool returns an executionId that must be polled using get_scheduled_execution_result to retrieve the final verification result.\n\nPreconditions: You MUST have a valid credentialId or secretId. You MUST have the componentId and workspaceId.\nPostconditions: Returns an executionId. You MUST call get_scheduled_execution_result with this executionId to get the verification result. If status is "pending", wait 2-3 seconds and poll again.',
415
+ inputSchema: {
416
+ type: 'object',
417
+ properties: {
418
+ workspaceId: {
419
+ type: 'string',
420
+ description: 'The unique identifier of the workspace.'
421
+ },
422
+ componentId: {
423
+ type: 'string',
424
+ description: 'The unique identifier of the component.'
425
+ },
426
+ versionId: {
427
+ type: 'string',
428
+ description: 'Optional. The component version ID (Git revision). Defaults to "latest".',
429
+ default: 'latest'
430
+ },
431
+ credentialId: {
432
+ type: 'string',
433
+ description: 'The unique identifier of the existing credential to verify. Either credentialId or secretId must be provided.'
434
+ },
435
+ secretId: {
436
+ type: 'string',
437
+ description: 'The unique identifier of the existing secret to verify. Either credentialId or secretId must be provided.'
438
+ },
439
+ fields: {
440
+ type: 'object',
441
+ description: 'Optional overrides for the credential/secret configuration fields to verify.'
442
+ },
443
+ logLevel: {
444
+ type: 'string',
445
+ enum: ['trace', 'debug', 'info', 'warn', 'error', 'fatal'],
446
+ description: 'Optional. The log level of the component verification step.',
447
+ default: 'info'
448
+ }
449
+ },
450
+ required: ['workspaceId', 'componentId']
451
+ }
452
+ },
453
+ {
454
+ name: 'list_auth_clients',
455
+ description: 'List registered authentication clients (OAuth2 configurations storing client ID and secret) available in a workspace, contract, or tenant.',
456
+ inputSchema: {
457
+ type: 'object',
458
+ properties: {
459
+ workspaceId: {
460
+ type: 'string',
461
+ description: 'Optional. Show auth clients available in the given workspace (including contract\'s, tenant\'s, and global auth-clients). Only one of workspaceId, contractId, or tenantId should be specified.'
462
+ },
463
+ contractId: {
464
+ type: 'string',
465
+ description: 'Optional. Show auth clients available in the given contract (including tenant\'s and global auth-clients).'
466
+ },
467
+ tenantId: {
468
+ type: 'string',
469
+ description: 'Optional. Show auth clients available in the given tenant and global scope.'
470
+ },
471
+ componentId: {
472
+ type: 'string',
473
+ description: 'Optional. Filter the auth clients for a specific component ID.'
474
+ }
475
+ },
476
+ required: []
477
+ }
478
+ },
479
+ {
480
+ name: 'list_components',
481
+ description: 'List all available component connectors in a specific workspace to retrieve their IDs. Returns a lightweight technical summary of each component. Does NOT contain real-world step configurations, usage examples, or JSONata mappings.\n\nPreconditions: You MUST have a workspaceId from list_workspaces. Always use the search parameter to filter results.\nPostconditions: If multiple components match, you MUST stop and ask the user which one to use. Do NOT proceed to get_component or any other tool until the user selects a specific component. After selecting, call get_component with the chosen componentId.',
482
+ inputSchema: {
483
+ type: 'object',
484
+ properties: {
485
+ workspaceId: {
486
+ type: 'string',
487
+ description: 'The unique identifier of the workspace.'
488
+ },
489
+ search: {
490
+ type: 'string',
491
+ description: 'Optional search query to filter components by name or description.'
492
+ }
493
+ },
494
+ required: ['workspaceId']
495
+ }
496
+ },
497
+ {
498
+ name: 'list_contracts',
499
+ description: 'List all contracts accessible with the current user credentials.\n\nPreconditions: Only call this tool when the user explicitly asks to list contracts or when you need a contractId for subsequent operations and the user has not provided one.\nPostconditions: If multiple contracts are returned, you MUST stop and ask the user which contract to use. Do NOT assume or select one automatically.',
500
+ inputSchema: {
501
+ type: 'object',
502
+ properties: {
503
+ pageSize: {
504
+ type: 'number',
505
+ description: 'Optional page size (number of items per page). Default is 20. Maximum is 20.',
506
+ maximum: 20
507
+ },
508
+ pageNumber: {
509
+ type: 'number',
510
+ description: 'Optional page number (1-based index). Default is 1.'
511
+ }
512
+ },
513
+ required: []
514
+ }
515
+ },
516
+ {
517
+ name: 'list_credentials',
518
+ description: 'List pre-created, authenticated connections (credentials) in a workspace for a specific component ID. IMPORTANT: Some newer components (especially those using OAuth2 like Salesforce v2, REST API v2, Google Sheets v2, Zoho) use Secrets instead of Credentials. When looking for existing connections, you should check both list_credentials and list_secrets for the given component.\n\nPreconditions: You MUST have a componentId from list_components/get_component. Always call BOTH list_credentials AND list_secrets for the same component to get a complete picture.\nPostconditions: If multiple credentials are found, you MUST stop and ask the user which one to use. If no credentials are found, inform the user and offer to create new ones via create_credentials.',
519
+ inputSchema: {
520
+ type: 'object',
521
+ properties: {
522
+ workspaceId: {
523
+ type: 'string',
524
+ description: 'The unique identifier of the workspace.'
525
+ },
526
+ componentId: {
527
+ type: 'string',
528
+ description: 'The unique identifier of the component to filter credentials.'
529
+ }
530
+ },
531
+ required: ['workspaceId', 'componentId']
532
+ }
533
+ },
534
+ {
535
+ name: 'list_flows',
536
+ description: 'List active and inactive integration flows in a specific workspace. Returns a lightweight summary of each flow. Use get_flow with the flow ID to retrieve its detailed configuration.\n\nPreconditions: You MUST have a workspaceId from list_workspaces or from the user.\nPostconditions: Returns flow summaries (id, name, status, stepCount). To get full configuration, call get_flow with the specific flowId.',
537
+ inputSchema: {
538
+ type: 'object',
539
+ properties: {
540
+ workspaceId: {
541
+ type: 'string',
542
+ description: 'The unique identifier of the workspace.'
543
+ },
544
+ pageSize: {
545
+ type: 'number',
546
+ description: 'Optional page size (number of items per page). Default is 50.'
547
+ },
548
+ pageNumber: {
549
+ type: 'number',
550
+ description: 'Optional page number (1-based index). Default is 1.'
551
+ },
552
+ search: {
553
+ type: 'string',
554
+ description: 'Optional search query to filter flows by name or description.'
555
+ },
556
+ status: {
557
+ type: 'string',
558
+ enum: ['active', 'inactive'],
559
+ description: 'Optional filter to list only "active" or "inactive" flows.'
560
+ },
561
+ type: {
562
+ type: 'string',
563
+ enum: ['ordinary', 'long_running'],
564
+ description: 'Optional filter to list flows by type: "ordinary" or "long_running".'
565
+ },
566
+ componentId: {
567
+ type: 'string',
568
+ description: 'Optional filter to list flows that use a specific component ID.'
569
+ },
570
+ hasDraft: {
571
+ type: 'boolean',
572
+ description: 'Optional filter to list only flows with or without a draft.'
573
+ },
574
+ userId: {
575
+ type: 'string',
576
+ description: 'Optional filter to list flows created by a specific user ID.'
577
+ },
578
+ include: {
579
+ type: 'string',
580
+ enum: ['flow-containers', 'descriptor'],
581
+ description: 'Optional related resources to include: "flow-containers" or "descriptor".'
582
+ },
583
+ sort: {
584
+ type: 'string',
585
+ enum: ['created_at', 'updated_at', 'name', '-created_at', '-updated_at', '-name'],
586
+ description: 'Optional sorting fields: prefix with "-" for descending order.'
587
+ }
588
+ },
589
+ required: ['workspaceId']
590
+ }
591
+ },
592
+ {
593
+ name: 'list_secrets',
594
+ description: 'List authentication secrets in a workspace for a specific component ID. Secrets are typically used by newer OAuth2 components (such as Salesforce v2, REST API v2, Google Sheets v2, Zoho) to store and auto-refresh credentials. IMPORTANT: When searching for credentials/secrets, you should check both list_credentials and list_secrets for the given component.\n\nPreconditions: You MUST have a componentId from list_components/get_component. Always call BOTH list_credentials AND list_secrets for the same component.\nPostconditions: If multiple secrets are found, you MUST stop and ask the user which one to use. If no secrets are found, inform the user and offer to create new ones via create_credentials.',
595
+ inputSchema: {
596
+ type: 'object',
597
+ properties: {
598
+ workspaceId: {
599
+ type: 'string',
600
+ description: 'The unique identifier of the workspace.'
601
+ },
602
+ componentId: {
603
+ type: 'string',
604
+ description: 'The unique identifier of the component to filter secrets.'
605
+ }
606
+ },
607
+ required: ['workspaceId', 'componentId']
608
+ }
609
+ },
610
+ {
611
+ name: 'list_workspaces',
612
+ description: 'List all workspaces accessible with the current user credentials, filtered by contractId.\n\nPreconditions: You MUST have a contractId from list_contracts. Do NOT call this without a contractId.\nPostconditions: If multiple workspaces are returned, you MUST stop and ask the user which workspace to use. Do NOT assume or select one automatically.',
613
+ inputSchema: {
614
+ type: 'object',
615
+ properties: {
616
+ contractId: {
617
+ type: 'string',
618
+ description: 'Optional contract ID to filter workspaces. Highly recommended for multi-tenant users.'
619
+ },
620
+ pageSize: {
621
+ type: 'number',
622
+ description: 'Optional page size (number of items per page). Default is 50.'
623
+ },
624
+ pageNumber: {
625
+ type: 'number',
626
+ description: 'Optional page number (1-based index). Default is 1.'
627
+ }
628
+ },
629
+ required: ['contractId']
630
+ }
631
+ },
632
+ {
633
+ name: DESTRUCTIVE_TOOL_NAMES.RUN_FLOW_NOW,
634
+ description: 'Trigger a manual, one-off execution of an integration flow.\n\nPreconditions: The flow MUST be in ACTIVE state. If the flow is inactive, call start_flow first. You SHOULD have called get_flow to verify the flow is properly configured before triggering execution.\nPostconditions: The flow execution is triggered asynchronously. Use get_logs to check execution results. After retrieving logs, follow Playbook C: present a structured Execution Analysis (health by step, error patterns, data flow), then ask the user whether they want fixes applied or a full assessment with improvement suggestions.',
635
+ inputSchema: {
636
+ type: 'object',
637
+ properties: {
638
+ flowId: {
639
+ type: 'string',
640
+ description: 'The unique identifier of the flow.'
641
+ }
642
+ },
643
+ required: ['flowId']
644
+ }
645
+ },
646
+ {
647
+ name: 'search_documentation',
648
+ description: 'Search the documentation semantically using Gemini Embedding 2 and Qdrant. Returns relevant text chunks and images. Note: This tool does NOT contain REST API payload examples, schemas, or flow JSON structures. For REST API flow payload structures, schemas, and modification guides, you must read the resource "elasticio://docs/flow-building-guide".\n\nPreconditions: Use this tool ONLY for conceptual/how-to questions about the platform. Do NOT use it to find API payload formats or JSON structures (use the flow-building-guide resource instead).\nPostconditions: Returns relevant documentation chunks. If the answer is not found, tell the user rather than guessing.',
649
+ inputSchema: {
650
+ type: 'object',
651
+ properties: {
652
+ query: {
653
+ type: 'string',
654
+ description: 'The semantic query or phrase to search (e.g., "how to set up rebounds", "cron trigger format").'
655
+ }
656
+ },
657
+ required: ['query']
658
+ }
659
+ },
660
+ {
661
+ name: 'search_flow_samples',
662
+ description: 'Search the vector database of integration flow samples to find complete, real-world examples of how entire flows are structured and built. Use this ONLY when asked to search or explain general flow layouts. Calling this tool is strictly PROHIBITED during new flow creation or when discovering component/credential IDs (instead, ask the user).\n\nPreconditions: PROHIBITED during flow creation (Playbook A) or component/credential discovery. Only use when the user explicitly asks for examples or when debugging.\nPostconditions: Returns example flow structures. These are reference examples only — do NOT copy component IDs, credential IDs, or version hashes from them.',
663
+ inputSchema: {
664
+ type: 'object',
665
+ properties: {
666
+ query: {
667
+ type: 'string',
668
+ description: 'The natural language query or use case (e.g. "salesforce query and upsert", "cron trigger timer").'
669
+ },
670
+ limit: {
671
+ type: 'number',
672
+ description: 'Optional maximum number of matches to return. Default is 5.'
673
+ }
674
+ },
675
+ required: ['query']
676
+ }
677
+ },
678
+ {
679
+ name: 'search_flow_steps',
680
+ description: 'Search the vector database of individual flow steps to find actual real-world usage examples, concrete configurations, and JSONata mappings for a particular component or action. Use this ONLY for historical configuration reference. Calling this tool is strictly PROHIBITED during new flow creation or when discovering component/credential IDs (instead, ask the user).\n\nPreconditions: PROHIBITED during flow creation (Playbook A) or component/credential discovery. Only use for historical reference or when the user asks for configuration examples.\nPostconditions: Returns example step configurations. Do NOT copy component IDs, credential IDs, or version hashes from these examples — always use fresh values from get_component.',
681
+ inputSchema: {
682
+ type: 'object',
683
+ properties: {
684
+ query: {
685
+ type: 'string',
686
+ description: 'The natural language query or component/action name (e.g. "salesforce create account step", "JSONata filter date modification").'
687
+ },
688
+ limit: {
689
+ type: 'number',
690
+ description: 'Optional maximum number of matches to return. Default is 5.'
691
+ }
692
+ },
693
+ required: ['query']
694
+ }
695
+ },
696
+ {
697
+ name: DESTRUCTIVE_TOOL_NAMES.START_FLOW,
698
+ description: 'Activate and start a configured integration flow.\n\nPreconditions: The flow MUST be in INACTIVE state and fully configured with valid components, credentials, and mappings. You SHOULD have called get_flow to verify the configuration.\nPostconditions: The flow transitions to ACTIVE state. Poll get_flow to confirm the status change.',
699
+ inputSchema: {
700
+ type: 'object',
701
+ properties: {
702
+ flowId: {
703
+ type: 'string',
704
+ description: 'The unique identifier of the flow.'
705
+ }
706
+ },
707
+ required: ['flowId']
708
+ }
709
+ },
710
+ {
711
+ name: DESTRUCTIVE_TOOL_NAMES.STOP_FLOW,
712
+ description: 'Deactivate and stop a running integration flow.\n\nPreconditions: The flow MUST be in ACTIVE state.\nPostconditions: The flow transitions to INACTIVE state. You MUST poll get_flow until status === "inactive" before making any modifications (Playbook B requires this).',
713
+ inputSchema: {
714
+ type: 'object',
715
+ properties: {
716
+ flowId: {
717
+ type: 'string',
718
+ description: 'The unique identifier of the flow.'
719
+ }
720
+ },
721
+ required: ['flowId']
722
+ }
723
+ },
724
+ {
725
+ name: DESTRUCTIVE_TOOL_NAMES.UPDATE_FLOW,
726
+ description: 'Update/Patch a specific integration flow directly. The body of the request must be fully constructed as a valid JSON API patch payload containing data (id, type: "flow", attributes, etc.). CRITICAL: All edges with mappers MUST follow the JSONata mapping rules (use $getPassthrough().step_id.body.field for variables, and use double quotes (escaped as \\") for literals without wrapping the entire expression in outer quotes).\n\nPreconditions (Playbook B — all required):\n1. You MUST have called get_flow to inspect the current graph.\n2. The flow MUST be INACTIVE. If active, call stop_flow first and poll get_flow until status === "inactive".\n3. You MUST have read the resource elasticio://docs/flow-building-guide.\n4. You MUST have called get_component for any NEW components being added.\n5. You MUST have called list_credentials/list_secrets for any NEW components requiring auth.\n6. For any modified or new edges with mappers, you MUST have called init_dynamic_metadata for BOTH the source step (to get its output schema for mapper values) AND the target step (to get its input schema for mapper keys). Do NOT guess output field names.\nPostconditions: Returns the updated flow. Call start_flow to reactivate it.',
727
+ inputSchema: {
728
+ type: 'object',
729
+ properties: {
730
+ flowId: {
731
+ type: 'string',
732
+ description: 'The unique identifier of the integration flow to update.'
733
+ },
734
+ expectedRevision: {
735
+ type: 'string',
736
+ description: 'The revision string from get_flow_build_status or get_flow. Required for optimistic concurrency control.'
737
+ },
738
+ body: {
739
+ type: 'object',
740
+ description: 'The JSON API compliant PATCH request body payload.'
741
+ }
742
+ },
743
+ required: ['flowId', 'body', 'expectedRevision']
744
+ }
745
+ },
746
+ {
747
+ name: DESTRUCTIVE_TOOL_NAMES.UPDATE_FLOW_DRAFT,
748
+ description: 'Update the draft layout, parameters, or step mappings of an integration flow directly. The body of the request must be fully constructed as a valid JSON API payload containing type: "flow-draft", id matching the flowId, and attributes. CRITICAL: All edges with mappers MUST follow the JSONata mapping rules (use $getPassthrough().step_id.body.field for variables, and use double quotes (escaped as \\") for literals without wrapping the entire expression in outer quotes).\n\nPreconditions (Playbook B — all required):\n1. You MUST have called get_flow to inspect the current graph.\n2. The flow MUST be INACTIVE.\n3. You MUST have read the resource elasticio://docs/flow-building-guide.\nPostconditions: Returns the updated draft. The draft must be published (via update_flow or the UI) to take effect.',
749
+ inputSchema: {
750
+ type: 'object',
751
+ properties: {
752
+ flowId: {
753
+ type: 'string',
754
+ description: 'The unique identifier of the flow.'
755
+ },
756
+ expectedRevision: {
757
+ type: 'string',
758
+ description: 'The revision string from get_flow_build_status or get_flow. Required for optimistic concurrency control.'
759
+ },
760
+ body: {
761
+ type: 'object',
762
+ description: 'The JSON API compliant PUT request body payload.'
763
+ }
764
+ },
765
+ required: ['flowId', 'body', 'expectedRevision']
766
+ }
767
+ },
768
+ {
769
+ name: 'get_data_sample',
770
+ description: 'Retrieve a specific data sample by its ID. Data samples store example input/output data for flow steps, which is used for building mappings between steps.\n\nPreconditions: You MUST have the dataSampleId.\nPostconditions: Returns the data sample with its result body, component, and method.',
771
+ inputSchema: {
772
+ type: 'object',
773
+ properties: {
774
+ dataSampleId: {
775
+ type: 'string',
776
+ description: 'The unique identifier of the data sample.'
777
+ },
778
+ flowId: {
779
+ type: 'string',
780
+ description: 'Optional. Flow ID to validate the sample against a specific flow step.'
781
+ },
782
+ stepId: {
783
+ type: 'string',
784
+ description: 'Optional. Step ID within the flow. Required if flowId is provided.'
785
+ }
786
+ },
787
+ required: ['dataSampleId']
788
+ }
789
+ },
790
+ {
791
+ name: DESTRUCTIVE_TOOL_NAMES.CREATE_DATA_SAMPLE,
792
+ description: 'Create a new data sample for a component action/trigger. Data samples store example output data for flow steps and are used for building mappings between steps.\n\nPreconditions: You MUST have the componentId and workspaceId. You SHOULD have called get_component to get the correct componentVersion and method (action/trigger name).\nPostconditions: Returns the created data sample with its ID. Link it to a flow step by updating the flow\'s nodes_config with the data_sample_id.',
793
+ inputSchema: {
794
+ type: 'object',
795
+ properties: {
796
+ workspaceId: {
797
+ type: 'string',
798
+ description: 'The unique identifier of the workspace.'
799
+ },
800
+ componentId: {
801
+ type: 'string',
802
+ description: 'The unique identifier of the component.'
803
+ },
804
+ componentVersion: {
805
+ type: 'string',
806
+ description: 'The component version hash (Git revision). Get this from get_component\'s latestVersionId field.'
807
+ },
808
+ method: {
809
+ type: 'string',
810
+ description: 'The action or trigger name (e.g. "receive", "execute", "getUpdatedObjectsPolling").'
811
+ },
812
+ body: {
813
+ type: 'object',
814
+ description: 'The sample data body — the example output that this step produces. This is placed inside result.body in the API payload.'
815
+ },
816
+ flowId: {
817
+ type: 'string',
818
+ description: 'Optional. Flow ID to attach the sample to a specific flow step.'
819
+ },
820
+ stepId: {
821
+ type: 'string',
822
+ description: 'Optional. Step ID within the flow to attach the sample to. Required if flowId is provided.'
823
+ },
824
+ expectedRevision: {
825
+ type: 'string',
826
+ description: 'Optional. The revision string from get_flow_build_status. Required when flowId and stepId are provided.'
827
+ }
828
+ },
829
+ required: ['workspaceId', 'componentId', 'componentVersion', 'method', 'body']
830
+ }
831
+ },
832
+ {
833
+ name: DESTRUCTIVE_TOOL_NAMES.UPDATE_DATA_SAMPLE,
834
+ description: 'Update an existing data sample with new result body data.\n\nPreconditions: You MUST have the dataSampleId from a previous get_data_sample, create_data_sample call, or from the flow\'s nodes_config.\nPostconditions: Returns the updated data sample.',
835
+ inputSchema: {
836
+ type: 'object',
837
+ properties: {
838
+ dataSampleId: {
839
+ type: 'string',
840
+ description: 'The unique identifier of the data sample to update.'
841
+ },
842
+ body: {
843
+ type: 'object',
844
+ description: 'The new sample data body. This replaces the existing result.body in the data sample.'
845
+ }
846
+ },
847
+ required: ['dataSampleId', 'body']
848
+ }
849
+ },
850
+ {
851
+ name: DESTRUCTIVE_TOOL_NAMES.DEBUG_FLOW_STEP,
852
+ description: 'Execute a single component step in debug mode and return the output synchronously. This triggers a real execution of the component with the provided credentials, configuration, and optional input data. Use this to retrieve a live data sample from a component.\n\nPreconditions: You MUST know the component command (from get_component), credentials ID (from list_credentials/list_secrets), and workspace ID.\nPostconditions: Returns the component execution output (body, headers, etc.). The result can be used as a data sample.',
853
+ inputSchema: {
854
+ type: 'object',
855
+ properties: {
856
+ workspaceId: {
857
+ type: 'string',
858
+ description: 'The workspace ID where the flow will be debugged.'
859
+ },
860
+ command: {
861
+ type: 'string',
862
+ description: 'The component command in format "owner/repo:action@version" (e.g. "elasticio/webhook:receive@abc123").'
863
+ },
864
+ credentialsId: {
865
+ type: 'string',
866
+ description: 'The credentials ID to use for the component (optional for components that do not require auth).'
867
+ },
868
+ secretId: {
869
+ type: 'string',
870
+ description: 'The auth secret ID to use instead of credentials (optional, use either credentialsId or secretId).'
871
+ },
872
+ fields: {
873
+ type: 'object',
874
+ description: 'Optional component configuration fields (key-value pairs).'
875
+ },
876
+ sampleData: {
877
+ type: 'object',
878
+ description: 'Optional input data to pass to the component (simulates incoming message body).'
879
+ },
880
+ attachments: {
881
+ type: 'object',
882
+ description: 'Optional attachments to pass to the component at the message level (simulates msg.attachments). Keys are filenames, values are objects with "url" and "content-type" properties.'
883
+ },
884
+ stepId: {
885
+ type: 'string',
886
+ description: 'Optional step ID to use in the debug flow (e.g. "step_8"). Defaults to "step_1".'
887
+ },
888
+ flowId: {
889
+ type: 'string',
890
+ description: 'Optional. If provided, the debug result will be saved as a data sample and assigned to this step in the flow draft.'
891
+ },
892
+ componentId: {
893
+ type: 'string',
894
+ description: 'Optional. Required together with flowId to save the debug result as a data sample.'
895
+ },
896
+ expectedRevision: {
897
+ type: 'string',
898
+ description: 'Optional. The revision string from get_flow_build_status. Required when flowId is provided.'
899
+ }
900
+ },
901
+ required: ['workspaceId', 'command']
902
+ }
903
+ },
904
+ {
905
+ name: 'get_session_state',
906
+ description: 'Retrieve the current session discovery state — which components, credentials, secrets, and flows have been discovered or inspected in this session. Use this tool when you are unsure about what has already been discovered or need to verify preconditions before calling another tool.\n\nPreconditions: None — this tool can be called at any time.\nPostconditions: Returns the current session state. Use this to verify that all preconditions are met before calling create_flow, update_flow, or other tools that require prior discovery.',
907
+ inputSchema: {
908
+ type: 'object',
909
+ properties: {},
910
+ required: []
911
+ }
912
+ },
913
+ ];
914
+ export const TOOLS = withConfirmationSchemas(TOOL_DEFS);
915
+ //# sourceMappingURL=definitions.js.map