@flowdot.ai/mcp-server 1.0.0 → 1.0.2

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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -162
  3. package/bin/flowdot-mcp.js +15 -15
  4. package/dist/api-client.d.ts +2 -344
  5. package/dist/api-client.d.ts.map +1 -1
  6. package/dist/api-client.js +2 -784
  7. package/dist/api-client.js.map +1 -1
  8. package/dist/resources/index.d.ts +12 -0
  9. package/dist/resources/index.d.ts.map +1 -0
  10. package/dist/resources/index.js +2204 -0
  11. package/dist/resources/index.js.map +1 -0
  12. package/dist/server.d.ts.map +1 -1
  13. package/dist/server.js +19 -10
  14. package/dist/server.js.map +1 -1
  15. package/dist/tools/add-recipe-step.d.ts +23 -0
  16. package/dist/tools/add-recipe-step.d.ts.map +1 -0
  17. package/dist/tools/add-recipe-step.js +196 -0
  18. package/dist/tools/add-recipe-step.js.map +1 -0
  19. package/dist/tools/add-recipe-store.d.ts +19 -0
  20. package/dist/tools/add-recipe-store.d.ts.map +1 -0
  21. package/dist/tools/add-recipe-store.js +116 -0
  22. package/dist/tools/add-recipe-store.js.map +1 -0
  23. package/dist/tools/agent-toolkits.d.ts +57 -0
  24. package/dist/tools/agent-toolkits.d.ts.map +1 -0
  25. package/dist/tools/agent-toolkits.js +1712 -0
  26. package/dist/tools/agent-toolkits.js.map +1 -0
  27. package/dist/tools/append-app-code.d.ts +12 -0
  28. package/dist/tools/append-app-code.d.ts.map +1 -0
  29. package/dist/tools/append-app-code.js +83 -0
  30. package/dist/tools/append-app-code.js.map +1 -0
  31. package/dist/tools/browse-recipes.d.ts +16 -0
  32. package/dist/tools/browse-recipes.d.ts.map +1 -0
  33. package/dist/tools/browse-recipes.js +102 -0
  34. package/dist/tools/browse-recipes.js.map +1 -0
  35. package/dist/tools/clone-app.js +20 -20
  36. package/dist/tools/create-app-file.d.ts +11 -0
  37. package/dist/tools/create-app-file.d.ts.map +1 -0
  38. package/dist/tools/create-app-file.js +83 -0
  39. package/dist/tools/create-app-file.js.map +1 -0
  40. package/dist/tools/create-app.d.ts.map +1 -1
  41. package/dist/tools/create-app.js +47 -29
  42. package/dist/tools/create-app.js.map +1 -1
  43. package/dist/tools/create-knowledge-category.d.ts +16 -0
  44. package/dist/tools/create-knowledge-category.d.ts.map +1 -0
  45. package/dist/tools/create-knowledge-category.js +71 -0
  46. package/dist/tools/create-knowledge-category.js.map +1 -0
  47. package/dist/tools/create-recipe.d.ts +16 -0
  48. package/dist/tools/create-recipe.d.ts.map +1 -0
  49. package/dist/tools/create-recipe.js +92 -0
  50. package/dist/tools/create-recipe.js.map +1 -0
  51. package/dist/tools/delete-app-file.d.ts +11 -0
  52. package/dist/tools/delete-app-file.d.ts.map +1 -0
  53. package/dist/tools/delete-app-file.js +52 -0
  54. package/dist/tools/delete-app-file.js.map +1 -0
  55. package/dist/tools/delete-app.js +3 -3
  56. package/dist/tools/delete-knowledge-category.d.ts +12 -0
  57. package/dist/tools/delete-knowledge-category.d.ts.map +1 -0
  58. package/dist/tools/delete-knowledge-category.js +40 -0
  59. package/dist/tools/delete-knowledge-category.js.map +1 -0
  60. package/dist/tools/delete-knowledge-document.d.ts +12 -0
  61. package/dist/tools/delete-knowledge-document.d.ts.map +1 -0
  62. package/dist/tools/delete-knowledge-document.js +40 -0
  63. package/dist/tools/delete-knowledge-document.js.map +1 -0
  64. package/dist/tools/delete-recipe-step.d.ts +14 -0
  65. package/dist/tools/delete-recipe-step.d.ts.map +1 -0
  66. package/dist/tools/delete-recipe-step.js +65 -0
  67. package/dist/tools/delete-recipe-step.js.map +1 -0
  68. package/dist/tools/delete-recipe-store.d.ts +14 -0
  69. package/dist/tools/delete-recipe-store.d.ts.map +1 -0
  70. package/dist/tools/delete-recipe-store.js +65 -0
  71. package/dist/tools/delete-recipe-store.js.map +1 -0
  72. package/dist/tools/delete-recipe.d.ts +13 -0
  73. package/dist/tools/delete-recipe.d.ts.map +1 -0
  74. package/dist/tools/delete-recipe.js +59 -0
  75. package/dist/tools/delete-recipe.js.map +1 -0
  76. package/dist/tools/edit-app-code.d.ts +12 -0
  77. package/dist/tools/edit-app-code.d.ts.map +1 -0
  78. package/dist/tools/edit-app-code.js +110 -0
  79. package/dist/tools/edit-app-code.js.map +1 -0
  80. package/dist/tools/favorite-recipe.d.ts +13 -0
  81. package/dist/tools/favorite-recipe.d.ts.map +1 -0
  82. package/dist/tools/favorite-recipe.js +53 -0
  83. package/dist/tools/favorite-recipe.js.map +1 -0
  84. package/dist/tools/fork-recipe.d.ts +13 -0
  85. package/dist/tools/fork-recipe.d.ts.map +1 -0
  86. package/dist/tools/fork-recipe.js +56 -0
  87. package/dist/tools/fork-recipe.js.map +1 -0
  88. package/dist/tools/get-app-file.d.ts +11 -0
  89. package/dist/tools/get-app-file.d.ts.map +1 -0
  90. package/dist/tools/get-app-file.js +76 -0
  91. package/dist/tools/get-app-file.js.map +1 -0
  92. package/dist/tools/get-app-template.d.ts.map +1 -1
  93. package/dist/tools/get-app-template.js +65 -21
  94. package/dist/tools/get-app-template.js.map +1 -1
  95. package/dist/tools/get-app.js +54 -54
  96. package/dist/tools/get-knowledge-document.d.ts +12 -0
  97. package/dist/tools/get-knowledge-document.d.ts.map +1 -0
  98. package/dist/tools/get-knowledge-document.js +71 -0
  99. package/dist/tools/get-knowledge-document.js.map +1 -0
  100. package/dist/tools/get-knowledge-storage.d.ts +10 -0
  101. package/dist/tools/get-knowledge-storage.d.ts.map +1 -0
  102. package/dist/tools/get-knowledge-storage.js +54 -0
  103. package/dist/tools/get-knowledge-storage.js.map +1 -0
  104. package/dist/tools/get-recipe-definition.d.ts +15 -0
  105. package/dist/tools/get-recipe-definition.d.ts.map +1 -0
  106. package/dist/tools/get-recipe-definition.js +70 -0
  107. package/dist/tools/get-recipe-definition.js.map +1 -0
  108. package/dist/tools/get-recipe.d.ts +12 -0
  109. package/dist/tools/get-recipe.d.ts.map +1 -0
  110. package/dist/tools/get-recipe.js +88 -0
  111. package/dist/tools/get-recipe.js.map +1 -0
  112. package/dist/tools/index.d.ts.map +1 -1
  113. package/dist/tools/index.js +301 -1
  114. package/dist/tools/index.js.map +1 -1
  115. package/dist/tools/insert-app-code.d.ts +12 -0
  116. package/dist/tools/insert-app-code.d.ts.map +1 -0
  117. package/dist/tools/insert-app-code.js +97 -0
  118. package/dist/tools/insert-app-code.js.map +1 -0
  119. package/dist/tools/link-app-workflow.js +21 -21
  120. package/dist/tools/link-recipe.d.ts +14 -0
  121. package/dist/tools/link-recipe.d.ts.map +1 -0
  122. package/dist/tools/link-recipe.js +76 -0
  123. package/dist/tools/link-recipe.js.map +1 -0
  124. package/dist/tools/list-app-files.d.ts +11 -0
  125. package/dist/tools/list-app-files.d.ts.map +1 -0
  126. package/dist/tools/list-app-files.js +84 -0
  127. package/dist/tools/list-app-files.js.map +1 -0
  128. package/dist/tools/list-apps.js +8 -8
  129. package/dist/tools/list-knowledge-categories.d.ts +14 -0
  130. package/dist/tools/list-knowledge-categories.d.ts.map +1 -0
  131. package/dist/tools/list-knowledge-categories.js +107 -0
  132. package/dist/tools/list-knowledge-categories.js.map +1 -0
  133. package/dist/tools/list-knowledge-documents.d.ts +15 -0
  134. package/dist/tools/list-knowledge-documents.d.ts.map +1 -0
  135. package/dist/tools/list-knowledge-documents.js +129 -0
  136. package/dist/tools/list-knowledge-documents.js.map +1 -0
  137. package/dist/tools/list-recipe-steps.d.ts +12 -0
  138. package/dist/tools/list-recipe-steps.d.ts.map +1 -0
  139. package/dist/tools/list-recipe-steps.js +69 -0
  140. package/dist/tools/list-recipe-steps.js.map +1 -0
  141. package/dist/tools/list-recipe-stores.d.ts +12 -0
  142. package/dist/tools/list-recipe-stores.d.ts.map +1 -0
  143. package/dist/tools/list-recipe-stores.js +87 -0
  144. package/dist/tools/list-recipe-stores.js.map +1 -0
  145. package/dist/tools/list-recipes.d.ts +12 -0
  146. package/dist/tools/list-recipes.d.ts.map +1 -0
  147. package/dist/tools/list-recipes.js +92 -0
  148. package/dist/tools/list-recipes.js.map +1 -0
  149. package/dist/tools/list-user-teams.d.ts +11 -0
  150. package/dist/tools/list-user-teams.d.ts.map +1 -0
  151. package/dist/tools/list-user-teams.js +56 -0
  152. package/dist/tools/list-user-teams.js.map +1 -0
  153. package/dist/tools/move-document-to-category.d.ts +13 -0
  154. package/dist/tools/move-document-to-category.d.ts.map +1 -0
  155. package/dist/tools/move-document-to-category.js +42 -0
  156. package/dist/tools/move-document-to-category.js.map +1 -0
  157. package/dist/tools/prepend-app-code.d.ts +12 -0
  158. package/dist/tools/prepend-app-code.d.ts.map +1 -0
  159. package/dist/tools/prepend-app-code.js +79 -0
  160. package/dist/tools/prepend-app-code.js.map +1 -0
  161. package/dist/tools/publish-app.js +7 -7
  162. package/dist/tools/query-knowledge-base.d.ts +18 -0
  163. package/dist/tools/query-knowledge-base.d.ts.map +1 -0
  164. package/dist/tools/query-knowledge-base.js +144 -0
  165. package/dist/tools/query-knowledge-base.js.map +1 -0
  166. package/dist/tools/rename-app-file.d.ts +11 -0
  167. package/dist/tools/rename-app-file.d.ts.map +1 -0
  168. package/dist/tools/rename-app-file.js +64 -0
  169. package/dist/tools/rename-app-file.js.map +1 -0
  170. package/dist/tools/reprocess-document.d.ts +12 -0
  171. package/dist/tools/reprocess-document.d.ts.map +1 -0
  172. package/dist/tools/reprocess-document.js +40 -0
  173. package/dist/tools/reprocess-document.js.map +1 -0
  174. package/dist/tools/search-apps.js +13 -13
  175. package/dist/tools/search.d.ts +14 -0
  176. package/dist/tools/search.d.ts.map +1 -0
  177. package/dist/tools/search.js +86 -0
  178. package/dist/tools/search.js.map +1 -0
  179. package/dist/tools/set-app-entry-file.d.ts +11 -0
  180. package/dist/tools/set-app-entry-file.d.ts.map +1 -0
  181. package/dist/tools/set-app-entry-file.js +56 -0
  182. package/dist/tools/set-app-entry-file.js.map +1 -0
  183. package/dist/tools/transfer-document-ownership.d.ts +15 -0
  184. package/dist/tools/transfer-document-ownership.d.ts.map +1 -0
  185. package/dist/tools/transfer-document-ownership.js +66 -0
  186. package/dist/tools/transfer-document-ownership.js.map +1 -0
  187. package/dist/tools/unlink-app-workflow.js +2 -2
  188. package/dist/tools/unpublish-app.js +2 -2
  189. package/dist/tools/update-app-file.d.ts +11 -0
  190. package/dist/tools/update-app-file.d.ts.map +1 -0
  191. package/dist/tools/update-app-file.js +73 -0
  192. package/dist/tools/update-app-file.js.map +1 -0
  193. package/dist/tools/update-app.d.ts.map +1 -1
  194. package/dist/tools/update-app.js +8 -1
  195. package/dist/tools/update-app.js.map +1 -1
  196. package/dist/tools/update-knowledge-category.d.ts +15 -0
  197. package/dist/tools/update-knowledge-category.d.ts.map +1 -0
  198. package/dist/tools/update-knowledge-category.js +74 -0
  199. package/dist/tools/update-knowledge-category.js.map +1 -0
  200. package/dist/tools/update-recipe-step.d.ts +22 -0
  201. package/dist/tools/update-recipe-step.d.ts.map +1 -0
  202. package/dist/tools/update-recipe-step.js +97 -0
  203. package/dist/tools/update-recipe-step.js.map +1 -0
  204. package/dist/tools/update-recipe-store.d.ts +20 -0
  205. package/dist/tools/update-recipe-store.d.ts.map +1 -0
  206. package/dist/tools/update-recipe-store.js +98 -0
  207. package/dist/tools/update-recipe-store.js.map +1 -0
  208. package/dist/tools/update-recipe.d.ts +18 -0
  209. package/dist/tools/update-recipe.d.ts.map +1 -0
  210. package/dist/tools/update-recipe.js +98 -0
  211. package/dist/tools/update-recipe.js.map +1 -0
  212. package/dist/tools/upload-document-from-url.d.ts +16 -0
  213. package/dist/tools/upload-document-from-url.d.ts.map +1 -0
  214. package/dist/tools/upload-document-from-url.js +73 -0
  215. package/dist/tools/upload-document-from-url.js.map +1 -0
  216. package/dist/tools/upload-text-document.d.ts +17 -0
  217. package/dist/tools/upload-text-document.d.ts.map +1 -0
  218. package/dist/tools/upload-text-document.js +77 -0
  219. package/dist/tools/upload-text-document.js.map +1 -0
  220. package/dist/tools/vote-recipe.d.ts +13 -0
  221. package/dist/tools/vote-recipe.d.ts.map +1 -0
  222. package/dist/tools/vote-recipe.js +54 -0
  223. package/dist/tools/vote-recipe.js.map +1 -0
  224. package/dist/types.d.ts +3 -666
  225. package/dist/types.d.ts.map +1 -1
  226. package/dist/types.js +3 -1
  227. package/dist/types.js.map +1 -1
  228. package/dist/utils/script-validator.d.ts.map +1 -1
  229. package/dist/utils/script-validator.js +5 -1
  230. package/dist/utils/script-validator.js.map +1 -1
  231. package/package.json +62 -54
@@ -17,9 +17,25 @@ FlowDot apps run in a sandboxed browser iframe with:
17
17
 
18
18
  ## CRITICAL CODE RULES
19
19
  1. NO IMPORTS - React is global (use React.useState, React.useEffect, React.useRef, etc.)
20
- 2. NO EXPORTS - Just define your function
20
+ 2. MUST include export default at the end: export default MyAppName;
21
21
  3. Function must be named: function MyAppName() { ... }
22
22
  4. Use Tailwind CSS for ALL styling
23
+ 5. NO FORM ELEMENTS - Never use <form> tags (sandbox blocks form submissions)
24
+ 6. ALL BUTTONS need type="button" to prevent unwanted form submission behavior
25
+
26
+ ## IMPORTANT: NO FORM ELEMENTS
27
+ The sandbox does not allow form submissions. NEVER use <form> tags.
28
+
29
+ ❌ WRONG:
30
+ <form onSubmit={handleSubmit}>
31
+ <button type="submit">Submit</button>
32
+ </form>
33
+
34
+ ✅ CORRECT:
35
+ <div>
36
+ <input onKeyDown={(e) => e.key === 'Enter' && handleClick()} />
37
+ <button type="button" onClick={handleClick}>Submit</button>
38
+ </div>
23
39
 
24
40
  ## WORKFLOW RESPONSE FORMAT
25
41
  invokeWorkflow returns data in this structure:
@@ -36,13 +52,17 @@ invokeWorkflow returns data in this structure:
36
52
  }
37
53
  }
38
54
 
39
- IMPORTANT: Use this helper function to extract outputs by node title:
55
+ IMPORTANT: Use this helper function to extract outputs safely:
40
56
  const getNodeOutput = (result, nodeTitle, socketName = 'Consolidated Text') => {
41
- const node = Object.values(result?.data || {}).find(n => n.nodeTitle === nodeTitle);
57
+ if (!result?.data) return null;
58
+ const node = Object.values(result.data).find(n => n.nodeTitle === nodeTitle);
42
59
  return node?.outputs?.[socketName]?.value;
43
60
  };
44
61
 
45
- Example: const weatherData = getNodeOutput(result, 'Weather Results', 'Consolidated Text');
62
+ Example:
63
+ const result = await invokeWorkflow('hash', { input });
64
+ const data = getNodeOutput(result, 'Output Node');
65
+ if (data) { /* use data */ }
46
66
 
47
67
  ## DISPLAY MODES
48
68
  Set config.displayMode to:
@@ -81,12 +101,14 @@ const TEMPLATES = {
81
101
 
82
102
  // Helper to extract output from workflow response by node title
83
103
  const getNodeOutput = (result, nodeTitle, socketName = 'Consolidated Text') => {
84
- const node = Object.values(result?.data || {}).find(n => n.nodeTitle === nodeTitle);
104
+ if (!result?.data) return null;
105
+ const node = Object.values(result.data).find(n => n.nodeTitle === nodeTitle);
85
106
  return node?.outputs?.[socketName]?.value;
86
107
  };
87
108
 
88
- const handleSubmit = async (e) => {
89
- e.preventDefault();
109
+ const handleSubmit = async () => {
110
+ if (!input.trim() || loading) return;
111
+
90
112
  setLoading(true);
91
113
  setError(null);
92
114
 
@@ -105,18 +127,25 @@ const TEMPLATES = {
105
127
  }
106
128
  };
107
129
 
130
+ const handleKeyDown = (e) => {
131
+ if (e.key === 'Enter' && !loading) {
132
+ handleSubmit();
133
+ }
134
+ };
135
+
108
136
  return (
109
137
  <div className="min-h-screen bg-gray-50 p-6">
110
138
  <div className="max-w-2xl mx-auto">
111
139
  <h1 className="text-2xl font-bold mb-6">My FlowDot App</h1>
112
140
 
113
- <form onSubmit={handleSubmit} className="space-y-4">
141
+ <div className="space-y-4">
114
142
  <div>
115
143
  <label className="block text-sm font-medium mb-1">Input</label>
116
144
  <input
117
145
  type="text"
118
146
  value={input}
119
147
  onChange={(e) => setInput(e.target.value)}
148
+ onKeyDown={handleKeyDown}
120
149
  placeholder="Enter your text..."
121
150
  className="w-full p-2 border rounded-lg focus:ring-2 focus:ring-blue-500"
122
151
  disabled={loading}
@@ -124,13 +153,14 @@ const TEMPLATES = {
124
153
  </div>
125
154
 
126
155
  <button
127
- type="submit"
156
+ type="button"
157
+ onClick={handleSubmit}
128
158
  disabled={loading || !input.trim()}
129
159
  className="w-full bg-blue-600 text-white py-2 px-4 rounded-lg hover:bg-blue-700 disabled:opacity-50"
130
160
  >
131
161
  {loading ? 'Processing...' : 'Submit'}
132
162
  </button>
133
- </form>
163
+ </div>
134
164
 
135
165
  {error && (
136
166
  <div className="mt-4 p-4 bg-red-50 text-red-700 rounded-lg">
@@ -149,7 +179,9 @@ const TEMPLATES = {
149
179
  </div>
150
180
  </div>
151
181
  );
152
- }`,
182
+ }
183
+
184
+ export default BasicFormApp;`,
153
185
  },
154
186
  chat: {
155
187
  name: 'Chat Interface',
@@ -282,7 +314,9 @@ const TEMPLATES = {
282
314
  </div>
283
315
  </div>
284
316
  );
285
- }`,
317
+ }
318
+
319
+ export default ChatApp;`,
286
320
  },
287
321
  dashboard: {
288
322
  name: 'Dashboard App',
@@ -404,7 +438,9 @@ const TEMPLATES = {
404
438
  </div>
405
439
  </div>
406
440
  );
407
- }`,
441
+ }
442
+
443
+ export default DashboardApp;`,
408
444
  },
409
445
  'form-builder': {
410
446
  name: 'Dynamic Form Builder',
@@ -420,7 +456,8 @@ const TEMPLATES = {
420
456
 
421
457
  // Helper to extract output from workflow response by node title
422
458
  const getNodeOutput = (result, nodeTitle, socketName = 'Consolidated Text') => {
423
- const node = Object.values(result?.data || {}).find(n => n.nodeTitle === nodeTitle);
459
+ if (!result?.data) return null;
460
+ const node = Object.values(result.data).find(n => n.nodeTitle === nodeTitle);
424
461
  return node?.outputs?.[socketName]?.value;
425
462
  };
426
463
 
@@ -449,8 +486,9 @@ const TEMPLATES = {
449
486
  setFormData(prev => ({ ...prev, [name]: value }));
450
487
  };
451
488
 
452
- const handleSubmit = async (e) => {
453
- e.preventDefault();
489
+ const handleSubmit = async () => {
490
+ if (loading) return;
491
+
454
492
  setLoading(true);
455
493
 
456
494
  try {
@@ -509,6 +547,7 @@ const TEMPLATES = {
509
547
  type="text"
510
548
  value={value || ''}
511
549
  onChange={(e) => handleChange(field.name, e.target.value)}
550
+ onKeyDown={(e) => e.key === 'Enter' && !loading && handleSubmit()}
512
551
  placeholder={field.description}
513
552
  className="w-full p-2 border rounded-lg"
514
553
  />
@@ -525,7 +564,7 @@ const TEMPLATES = {
525
564
  <div className="max-w-2xl mx-auto">
526
565
  <h1 className="text-2xl font-bold mb-6">Dynamic Form</h1>
527
566
 
528
- <form onSubmit={handleSubmit} className="space-y-4">
567
+ <div className="space-y-4">
529
568
  {inputSchema.map(field => (
530
569
  <div key={field.name}>
531
570
  <label className="block text-sm font-medium mb-1">
@@ -540,13 +579,14 @@ const TEMPLATES = {
540
579
  ))}
541
580
 
542
581
  <button
543
- type="submit"
582
+ type="button"
583
+ onClick={handleSubmit}
544
584
  disabled={loading}
545
585
  className="w-full bg-blue-600 text-white py-2 px-4 rounded-lg hover:bg-blue-700 disabled:opacity-50"
546
586
  >
547
587
  {loading ? 'Processing...' : 'Submit'}
548
588
  </button>
549
- </form>
589
+ </div>
550
590
 
551
591
  {result && (
552
592
  <div className="mt-6 p-4 bg-white rounded-lg shadow">
@@ -559,7 +599,9 @@ const TEMPLATES = {
559
599
  </div>
560
600
  </div>
561
601
  );
562
- }`,
602
+ }
603
+
604
+ export default DynamicFormApp;`,
563
605
  },
564
606
  'data-viewer': {
565
607
  name: 'Data Viewer',
@@ -710,7 +752,9 @@ const TEMPLATES = {
710
752
  </div>
711
753
  </div>
712
754
  );
713
- }`,
755
+ }
756
+
757
+ export default DataViewerApp;`,
714
758
  },
715
759
  };
716
760
  export async function handleGetAppTemplate(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"get-app-template.js","sourceRoot":"","sources":["../../src/tools/get-app-template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDA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const getAppTool = {
8
8
  name: 'get_app',
9
- description: `Get detailed information about a FlowDot app, including its React code and linked workflows.
10
-
11
- Apps are React frontend applications that can optionally call workflows as backends.
12
-
13
- Returns the full app details including:
14
- - Name, description, category, tags
15
- - React code (JSX/TSX)
16
- - Mobile code (if available)
17
- - Configuration
18
- - Linked workflows
9
+ description: `Get detailed information about a FlowDot app, including its React code and linked workflows.
10
+
11
+ Apps are React frontend applications that can optionally call workflows as backends.
12
+
13
+ Returns the full app details including:
14
+ - Name, description, category, tags
15
+ - React code (JSX/TSX)
16
+ - Mobile code (if available)
17
+ - Configuration
18
+ - Linked workflows
19
19
  - Usage statistics`,
20
20
  inputSchema: {
21
21
  type: 'object',
@@ -39,14 +39,14 @@ export async function handleGetApp(client, args) {
39
39
  const alias = w.alias ? ` (alias: ${w.alias})` : '';
40
40
  return ` - ${w.name} (${w.hash})${alias}`;
41
41
  });
42
- workflowsSection = `
43
- ## Linked Workflows
44
- ${workflowList.join('\n')}
45
-
46
- To invoke workflows from your app code, use:
47
- \`\`\`javascript
48
- const result = await invokeWorkflow('${app.workflows[0].hash}', { input: 'value' });
49
- \`\`\`
42
+ workflowsSection = `
43
+ ## Linked Workflows
44
+ ${workflowList.join('\n')}
45
+
46
+ To invoke workflows from your app code, use:
47
+ \`\`\`javascript
48
+ const result = await invokeWorkflow('${app.workflows[0].hash}', { input: 'value' });
49
+ \`\`\`
50
50
  `;
51
51
  }
52
52
  // Format tags
@@ -54,31 +54,31 @@ const result = await invokeWorkflow('${app.workflows[0].hash}', { input: 'value'
54
54
  // Format code section
55
55
  let codeSection = '';
56
56
  if (app.code) {
57
- codeSection = `
58
- ## App Code
59
- \`\`\`jsx
60
- ${app.code}
61
- \`\`\`
57
+ codeSection = `
58
+ ## App Code
59
+ \`\`\`jsx
60
+ ${app.code}
61
+ \`\`\`
62
62
  `;
63
63
  }
64
64
  // Format mobile code if exists
65
65
  let mobileCodeSection = '';
66
66
  if (app.mobile_code) {
67
- mobileCodeSection = `
68
- ## Mobile Code
69
- \`\`\`jsx
70
- ${app.mobile_code}
71
- \`\`\`
67
+ mobileCodeSection = `
68
+ ## Mobile Code
69
+ \`\`\`jsx
70
+ ${app.mobile_code}
71
+ \`\`\`
72
72
  `;
73
73
  }
74
74
  // Format config if exists
75
75
  let configSection = '';
76
76
  if (app.config && Object.keys(app.config).length > 0) {
77
- configSection = `
78
- ## Configuration
79
- \`\`\`json
80
- ${JSON.stringify(app.config, null, 2)}
81
- \`\`\`
77
+ configSection = `
78
+ ## Configuration
79
+ \`\`\`json
80
+ ${JSON.stringify(app.config, null, 2)}
81
+ \`\`\`
82
82
  `;
83
83
  }
84
84
  const badges = [];
@@ -87,27 +87,27 @@ ${JSON.stringify(app.config, null, 2)}
87
87
  if (app.is_featured)
88
88
  badges.push('Featured');
89
89
  const badgeStr = badges.length ? ` [${badges.join(', ')}]` : '';
90
- const text = `# ${app.name}${badgeStr}
91
-
92
- **ID:** ${app.id}
93
- **Status:** ${app.is_public ? 'Public' : 'Private'}
94
- **Category:** ${app.category || 'Uncategorized'}
95
- **Tags:** ${tags}
96
- **Mobile Compatible:** ${app.mobile_compatible ? 'Yes' : 'No'}
97
- **Can Edit:** ${app.can_edit ? 'Yes' : 'No'}
98
-
99
- ## Description
100
- ${app.description || 'No description provided.'}
101
-
102
- ## Statistics
103
- - Upvotes: ${app.upvotes} | Downvotes: ${app.downvotes}
104
- - Executions: ${app.execution_count}
105
- - Clones: ${app.clone_count}
106
- - Views: ${app.view_count || 0}
107
-
108
- **Created:** ${app.created_at}
109
- **Updated:** ${app.updated_at}
110
- ${app.published_at ? `**Published:** ${app.published_at}` : ''}
90
+ const text = `# ${app.name}${badgeStr}
91
+
92
+ **ID:** ${app.id}
93
+ **Status:** ${app.is_public ? 'Public' : 'Private'}
94
+ **Category:** ${app.category || 'Uncategorized'}
95
+ **Tags:** ${tags}
96
+ **Mobile Compatible:** ${app.mobile_compatible ? 'Yes' : 'No'}
97
+ **Can Edit:** ${app.can_edit ? 'Yes' : 'No'}
98
+
99
+ ## Description
100
+ ${app.description || 'No description provided.'}
101
+
102
+ ## Statistics
103
+ - Upvotes: ${app.upvotes} | Downvotes: ${app.downvotes}
104
+ - Executions: ${app.execution_count}
105
+ - Clones: ${app.clone_count}
106
+ - Views: ${app.view_count || 0}
107
+
108
+ **Created:** ${app.created_at}
109
+ **Updated:** ${app.updated_at}
110
+ ${app.published_at ? `**Published:** ${app.published_at}` : ''}
111
111
  ${workflowsSection}${codeSection}${mobileCodeSection}${configSection}`;
112
112
  return {
113
113
  content: [{ type: 'text', text }],
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Get Knowledge Document Tool
3
+ *
4
+ * Gets detailed information about a specific document.
5
+ */
6
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import { FlowDotApiClient } from '../api-client.js';
8
+ export declare const getKnowledgeDocumentToolDef: Tool;
9
+ export declare function handleGetKnowledgeDocument(api: FlowDotApiClient, args: {
10
+ document_id: number | string;
11
+ }): Promise<CallToolResult>;
12
+ //# sourceMappingURL=get-knowledge-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-knowledge-document.d.ts","sourceRoot":"","sources":["../../src/tools/get-knowledge-document.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,2BAA2B,EAAE,IAczC,CAAC;AAEF,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACrC,OAAO,CAAC,cAAc,CAAC,CAsDzB"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Get Knowledge Document Tool
3
+ *
4
+ * Gets detailed information about a specific document.
5
+ */
6
+ export const getKnowledgeDocumentToolDef = {
7
+ name: 'get_knowledge_document',
8
+ description: 'Get detailed information about a specific document in your knowledge base by ID or hash.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ document_id: {
13
+ type: ['number', 'string'],
14
+ description: 'The document ID (number) or hash (string)',
15
+ },
16
+ },
17
+ required: ['document_id'],
18
+ },
19
+ };
20
+ export async function handleGetKnowledgeDocument(api, args) {
21
+ try {
22
+ const doc = await api.getKnowledgeDocument(args.document_id);
23
+ const lines = [
24
+ `## Document: ${doc.title}`,
25
+ '',
26
+ `**ID:** ${doc.id}`,
27
+ `**Hash:** ${doc.hash}`,
28
+ `**Original Filename:** ${doc.original_filename}`,
29
+ '',
30
+ '### Status',
31
+ `- **Status:** ${doc.status}`,
32
+ doc.processing_error ? `- **Error:** ${doc.processing_error}` : '',
33
+ `- **Processed At:** ${doc.processed_at || 'Not yet processed'}`,
34
+ '',
35
+ '### Storage',
36
+ `- **Size:** ${doc.formatted_size} (${doc.file_size_bytes} bytes)`,
37
+ `- **MIME Type:** ${doc.mime_type}`,
38
+ '',
39
+ '### Processing',
40
+ `- **Chunks:** ${doc.chunk_count}`,
41
+ `- **Tokens:** ${doc.token_count}`,
42
+ `- **Has Embeddings:** ${doc.has_embeddings ? 'Yes' : 'No'}`,
43
+ '',
44
+ ].filter(Boolean);
45
+ if (doc.category) {
46
+ lines.push('### Category');
47
+ lines.push(`- **Name:** ${doc.category.name}`);
48
+ lines.push(`- **ID:** ${doc.category.id}`);
49
+ lines.push('');
50
+ }
51
+ if (doc.metadata && Object.keys(doc.metadata).length > 0) {
52
+ lines.push('### Metadata');
53
+ lines.push('```json');
54
+ lines.push(JSON.stringify(doc.metadata, null, 2));
55
+ lines.push('```');
56
+ lines.push('');
57
+ }
58
+ lines.push(`**Created:** ${doc.created_at}`);
59
+ return {
60
+ content: [{ type: 'text', text: lines.join('\n') }],
61
+ };
62
+ }
63
+ catch (error) {
64
+ const message = error instanceof Error ? error.message : 'Unknown error';
65
+ return {
66
+ content: [{ type: 'text', text: `Error getting document: ${message}` }],
67
+ isError: true,
68
+ };
69
+ }
70
+ }
71
+ //# sourceMappingURL=get-knowledge-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-knowledge-document.js","sourceRoot":"","sources":["../../src/tools/get-knowledge-document.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,2BAA2B,GAAS;IAC/C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,0FAA0F;IAC5F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAC1B,WAAW,EAAE,2CAA2C;aACzD;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,GAAqB,EACrB,IAAsC;IAEtC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE7D,MAAM,KAAK,GAAG;YACZ,gBAAgB,GAAG,CAAC,KAAK,EAAE;YAC3B,EAAE;YACF,WAAW,GAAG,CAAC,EAAE,EAAE;YACnB,aAAa,GAAG,CAAC,IAAI,EAAE;YACvB,0BAA0B,GAAG,CAAC,iBAAiB,EAAE;YACjD,EAAE;YACF,YAAY;YACZ,iBAAiB,GAAG,CAAC,MAAM,EAAE;YAC7B,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE;YAClE,uBAAuB,GAAG,CAAC,YAAY,IAAI,mBAAmB,EAAE;YAChE,EAAE;YACF,aAAa;YACb,eAAe,GAAG,CAAC,cAAc,KAAK,GAAG,CAAC,eAAe,SAAS;YAClE,oBAAoB,GAAG,CAAC,SAAS,EAAE;YACnC,EAAE;YAC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,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,OAAO,EAAE,EAAE,CAAC;YACvE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Get Knowledge Storage Tool
3
+ *
4
+ * Gets storage usage information for the knowledge base.
5
+ */
6
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import { FlowDotApiClient } from '../api-client.js';
8
+ export declare const getKnowledgeStorageToolDef: Tool;
9
+ export declare function handleGetKnowledgeStorage(api: FlowDotApiClient): Promise<CallToolResult>;
10
+ //# sourceMappingURL=get-knowledge-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-knowledge-storage.d.ts","sourceRoot":"","sources":["../../src/tools/get-knowledge-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,0BAA0B,EAAE,IASxC,CAAC;AAEF,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,cAAc,CAAC,CAyCzB"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Get Knowledge Storage Tool
3
+ *
4
+ * Gets storage usage information for the knowledge base.
5
+ */
6
+ export const getKnowledgeStorageToolDef = {
7
+ name: 'get_knowledge_storage',
8
+ description: 'Get storage usage information for your knowledge base, including total space used, limits, and document counts.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {},
12
+ required: [],
13
+ },
14
+ };
15
+ export async function handleGetKnowledgeStorage(api) {
16
+ try {
17
+ const storage = await api.getKnowledgeStorage();
18
+ // Create a visual progress bar
19
+ const barLength = 20;
20
+ const filledLength = Math.round((storage.usage_percentage / 100) * barLength);
21
+ const bar = '█'.repeat(filledLength) + '░'.repeat(barLength - filledLength);
22
+ const lines = [
23
+ '## Knowledge Base Storage',
24
+ '',
25
+ '### Usage',
26
+ `\`[${bar}]\` ${storage.usage_percentage.toFixed(1)}%`,
27
+ '',
28
+ `- **Knowledge Base:** ${storage.knowledge_storage_mb.toFixed(2)} MB`,
29
+ `- **Total Used:** ${storage.total_storage_mb.toFixed(2)} MB`,
30
+ `- **Storage Limit:** ${storage.storage_limit_mb.toFixed(2)} MB`,
31
+ `- **Available:** ${(storage.storage_limit_mb - storage.total_storage_mb).toFixed(2)} MB`,
32
+ '',
33
+ '### Documents',
34
+ `- **Total Documents:** ${storage.document_count}`,
35
+ `- **Ready Documents:** ${storage.ready_document_count}`,
36
+ `- **Categories:** ${storage.category_count}`,
37
+ ];
38
+ if (storage.usage_percentage > 80) {
39
+ lines.push('');
40
+ lines.push('⚠️ **Warning:** Storage usage is above 80%. Consider deleting unused documents.');
41
+ }
42
+ return {
43
+ content: [{ type: 'text', text: lines.join('\n') }],
44
+ };
45
+ }
46
+ catch (error) {
47
+ const message = error instanceof Error ? error.message : 'Unknown error';
48
+ return {
49
+ content: [{ type: 'text', text: `Error getting storage info: ${message}` }],
50
+ isError: true,
51
+ };
52
+ }
53
+ }
54
+ //# sourceMappingURL=get-knowledge-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-knowledge-storage.js","sourceRoot":"","sources":["../../src/tools/get-knowledge-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,0BAA0B,GAAS;IAC9C,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,iHAAiH;IACnH,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QA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C,CAAC;QAChG,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACpD,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,OAAO,EAAE,EAAE,CAAC;YAC3E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * get_recipe_definition MCP Tool
3
+ *
4
+ * Gets the complete recipe definition in YAML format for export or inspection.
5
+ * This is the canonical format for recipe definitions - both MCP and CLI
6
+ * should return identical YAML output for validation purposes.
7
+ */
8
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
9
+ import { FlowDotApiClient } from '../api-client.js';
10
+ export declare const getRecipeDefinitionTool: Tool;
11
+ export declare function handleGetRecipeDefinition(api: FlowDotApiClient, args: {
12
+ hash: string;
13
+ format?: 'yaml' | 'json';
14
+ }): Promise<CallToolResult>;
15
+ //# sourceMappingURL=get-recipe-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-recipe-definition.d.ts","sourceRoot":"","sources":["../../src/tools/get-recipe-definition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,uBAAuB,EAAE,IAmBrC,CAAC;AAEF,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC/C,OAAO,CAAC,cAAc,CAAC,CA0CzB"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * get_recipe_definition MCP Tool
3
+ *
4
+ * Gets the complete recipe definition in YAML format for export or inspection.
5
+ * This is the canonical format for recipe definitions - both MCP and CLI
6
+ * should return identical YAML output for validation purposes.
7
+ */
8
+ import yaml from 'js-yaml';
9
+ export const getRecipeDefinitionTool = {
10
+ name: 'get_recipe_definition',
11
+ description: 'Get the complete recipe definition in YAML format. Returns all steps, stores, entry_step_id, and configuration details. Use this to inspect or validate recipe definitions.',
12
+ inputSchema: {
13
+ type: 'object',
14
+ properties: {
15
+ hash: {
16
+ type: 'string',
17
+ description: 'The recipe hash/ID',
18
+ },
19
+ format: {
20
+ type: 'string',
21
+ enum: ['yaml', 'json'],
22
+ description: 'Output format: yaml (default) or json',
23
+ },
24
+ },
25
+ required: ['hash'],
26
+ },
27
+ };
28
+ export async function handleGetRecipeDefinition(api, args) {
29
+ try {
30
+ const definition = await api.getRecipeDefinition(args.hash);
31
+ const format = args.format || 'yaml';
32
+ let text;
33
+ let codeBlock;
34
+ if (format === 'json') {
35
+ text = JSON.stringify(definition, null, 2);
36
+ codeBlock = 'json';
37
+ }
38
+ else {
39
+ // YAML output - canonical format for recipe definitions
40
+ text = yaml.dump(definition, {
41
+ indent: 2,
42
+ lineWidth: 120,
43
+ noRefs: true,
44
+ sortKeys: false, // Preserve field order
45
+ });
46
+ codeBlock = 'yaml';
47
+ }
48
+ return {
49
+ content: [
50
+ {
51
+ type: 'text',
52
+ text: `Recipe Definition for ${args.hash}:\n\n\`\`\`${codeBlock}\n${text}\`\`\``,
53
+ },
54
+ ],
55
+ };
56
+ }
57
+ catch (error) {
58
+ const message = error instanceof Error ? error.message : 'Unknown error';
59
+ return {
60
+ content: [
61
+ {
62
+ type: 'text',
63
+ text: `Error getting recipe definition: ${message}`,
64
+ },
65
+ ],
66
+ isError: true,
67
+ };
68
+ }
69
+ }
70
+ //# sourceMappingURL=get-recipe-definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-recipe-definition.js","sourceRoot":"","sources":["../../src/tools/get-recipe-definition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAAM,CAAC,MAAM,uBAAuB,GAAS;IAC3C,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,6KAA6K;IAC/K,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;gBACtB,WAAW,EAAE,uCAAuC;aACrD;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,GAAqB,EACrB,IAAgD;IAEhD,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAErC,IAAI,IAAY,CAAC;QACjB,IAAI,SAAiB,CAAC;QAEtB,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC3C,SAAS,GAAG,MAAM,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,wDAAwD;YACxD,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBAC3B,MAAM,EAAE,CAAC;gBACT,SAAS,EAAE,GAAG;gBACd,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,KAAK,EAAE,uBAAuB;aACzC,CAAC,CAAC;YACH,SAAS,GAAG,MAAM,CAAC;QACrB,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,yBAAyB,IAAI,CAAC,IAAI,cAAc,SAAS,KAAK,IAAI,QAAQ;iBACjF;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,oCAAoC,OAAO,EAAE;iBACpD;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * get_recipe MCP Tool
3
+ *
4
+ * Gets detailed information about a specific agent recipe.
5
+ */
6
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import { FlowDotApiClient } from '../api-client.js';
8
+ export declare const getRecipeTool: Tool;
9
+ export declare function handleGetRecipe(api: FlowDotApiClient, args: {
10
+ hash: string;
11
+ }): Promise<CallToolResult>;
12
+ //# sourceMappingURL=get-recipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-recipe.d.ts","sourceRoot":"","sources":["../../src/tools/get-recipe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,aAAa,EAAE,IAc3B,CAAC;AAEF,wBAAsB,eAAe,CACnC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GACrB,OAAO,CAAC,cAAc,CAAC,CA0EzB"}