@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
@@ -0,0 +1,79 @@
1
+ /**
2
+ * prepend_app_code Tool
3
+ *
4
+ * Prepends content to the beginning of app code.
5
+ * Use this to add constants, configuration, or setup code at the start.
6
+ * Required scope: apps:manage
7
+ */
8
+ export const prependAppCodeTool = {
9
+ name: 'prepend_app_code',
10
+ description: `Prepends content to the beginning of app code.
11
+
12
+ CRITICAL: Remember export rules:
13
+ - NO IMPORTS - React is global
14
+ - App entry file MUST end with: export default MyAppName;
15
+
16
+ Use this tool when you need to:
17
+ - Add constants or configuration at the start of the code
18
+ - Add comments or documentation at the beginning
19
+ - Insert setup code before the main component
20
+
21
+ NOTE: Since FlowDot apps don't use imports, this is less commonly needed.
22
+ For most cases, use edit_app_code or insert_app_code instead.
23
+
24
+ Example usage:
25
+ - content: "// App Configuration\\nconst API_URL = 'https://api.example.com';\\n\\n"
26
+
27
+ Max code size: 102KB`,
28
+ inputSchema: {
29
+ type: 'object',
30
+ properties: {
31
+ app_id: {
32
+ type: 'string',
33
+ description: 'The app ID (hash)',
34
+ },
35
+ content: {
36
+ type: 'string',
37
+ description: 'The content to prepend to the beginning of the code',
38
+ },
39
+ field: {
40
+ type: 'string',
41
+ enum: ['code', 'mobile_code'],
42
+ description: 'Which code field to prepend to (default: "code")',
43
+ },
44
+ },
45
+ required: ['app_id', 'content'],
46
+ },
47
+ };
48
+ export async function handlePrependAppCode(client, args) {
49
+ try {
50
+ const appId = String(args.app_id);
51
+ const content = String(args.content);
52
+ const field = args.field || 'code';
53
+ const result = await client.prependAppCode(appId, {
54
+ content,
55
+ field,
56
+ });
57
+ const sizeDiff = result.new_length - result.previous_length;
58
+ return {
59
+ content: [{
60
+ type: 'text',
61
+ text: `Content prepended to app code successfully!
62
+
63
+ App ID: ${result.id}
64
+ Field: ${result.field}
65
+ Previous size: ${result.previous_length} bytes
66
+ New size: ${result.new_length} bytes (+${sizeDiff} bytes)
67
+ Updated at: ${result.updated_at}`,
68
+ }],
69
+ };
70
+ }
71
+ catch (error) {
72
+ const message = error instanceof Error ? error.message : 'Unknown error';
73
+ return {
74
+ content: [{ type: 'text', text: `Error prepending to app code: ${message}` }],
75
+ isError: true,
76
+ };
77
+ }
78
+ }
79
+ //# sourceMappingURL=prepend-app-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepend-app-code.js","sourceRoot":"","sources":["../../src/tools/prepend-app-code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE;;;;;;;;;;;;;;;;;qBAiBM;IACnB,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qDAAqD;aACnE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;gBAC7B,WAAW,EAAE,kDAAkD;aAChE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;KAChC;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAwB,EACxB,IAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,KAAK,GAAI,IAAI,CAAC,KAAgC,IAAI,MAAM,CAAC;QAE/D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE;YAChD,OAAO;YACP,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC;QAE5D,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;UAEJ,MAAM,CAAC,EAAE;SACV,MAAM,CAAC,KAAK;iBACJ,MAAM,CAAC,eAAe;YAC3B,MAAM,CAAC,UAAU,YAAY,QAAQ;cACnC,MAAM,CAAC,UAAU,EAAE;iBAC1B,CAAC;SACH,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,iCAAiC,OAAO,EAAE,EAAE,CAAC;YAC7E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -6,13 +6,13 @@
6
6
  */
7
7
  export const publishAppTool = {
8
8
  name: 'publish_app',
9
- description: `Publish an app to make it publicly visible in the FlowDot app marketplace.
10
-
11
- Once published:
12
- - Other users can discover and view your app
13
- - Other users can clone your app
14
- - Your app can receive votes and comments
15
-
9
+ description: `Publish an app to make it publicly visible in the FlowDot app marketplace.
10
+
11
+ Once published:
12
+ - Other users can discover and view your app
13
+ - Other users can clone your app
14
+ - Your app can receive votes and comments
15
+
16
16
  You can unpublish at any time using unpublish_app.`,
17
17
  inputSchema: {
18
18
  type: 'object',
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Query Knowledge Base Tool
3
+ *
4
+ * Performs RAG queries against the knowledge base to retrieve relevant document chunks.
5
+ * Supports filtering by team and controlling which document sources to include.
6
+ */
7
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
8
+ import { FlowDotApiClient } from '../api-client.js';
9
+ export declare const queryKnowledgeBaseToolDef: Tool;
10
+ export declare function handleQueryKnowledgeBase(api: FlowDotApiClient, args: {
11
+ query: string;
12
+ category_id?: number;
13
+ team_id?: number;
14
+ include_personal?: boolean;
15
+ include_team?: boolean;
16
+ top_k?: number;
17
+ }): Promise<CallToolResult>;
18
+ //# sourceMappingURL=query-knowledge-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-knowledge-base.d.ts","sourceRoot":"","sources":["../../src/tools/query-knowledge-base.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,yBAAyB,EAAE,IAoCvC,CAAC;AAEF,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,cAAc,CAAC,CA+GzB"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Query Knowledge Base Tool
3
+ *
4
+ * Performs RAG queries against the knowledge base to retrieve relevant document chunks.
5
+ * Supports filtering by team and controlling which document sources to include.
6
+ */
7
+ export const queryKnowledgeBaseToolDef = {
8
+ name: 'query_knowledge_base',
9
+ description: 'Search your knowledge base using semantic and keyword search. Returns relevant document chunks with source attribution. Use this to find information from your uploaded documents. By default searches both personal and team documents.',
10
+ inputSchema: {
11
+ type: 'object',
12
+ properties: {
13
+ query: {
14
+ type: 'string',
15
+ description: 'The search query - what information are you looking for?',
16
+ },
17
+ category_id: {
18
+ type: 'number',
19
+ description: 'Optional: Limit search to a specific category by ID',
20
+ },
21
+ team_id: {
22
+ type: 'number',
23
+ description: 'Optional: Limit search to a specific team\'s documents only. Use list_user_teams to see available teams.',
24
+ },
25
+ include_personal: {
26
+ type: 'boolean',
27
+ description: 'Optional: Include personal documents in the search. Default: true',
28
+ },
29
+ include_team: {
30
+ type: 'boolean',
31
+ description: 'Optional: Include team documents in the search. Default: true',
32
+ },
33
+ top_k: {
34
+ type: 'number',
35
+ description: 'Number of results to return (1-50, default: 5)',
36
+ minimum: 1,
37
+ maximum: 50,
38
+ },
39
+ },
40
+ required: ['query'],
41
+ },
42
+ };
43
+ export async function handleQueryKnowledgeBase(api, args) {
44
+ try {
45
+ const response = await api.queryKnowledgeBase({
46
+ query: args.query,
47
+ category_id: args.category_id,
48
+ team_id: args.team_id,
49
+ include_personal: args.include_personal,
50
+ include_team: args.include_team,
51
+ top_k: args.top_k || 5,
52
+ });
53
+ if (response.result_count === 0) {
54
+ let tips = [
55
+ 'Using different keywords',
56
+ 'Checking if documents are fully processed (status: ready)',
57
+ 'Removing category filters',
58
+ ];
59
+ if (args.include_personal === false || args.include_team === false) {
60
+ tips.push('Including both personal and team documents');
61
+ }
62
+ return {
63
+ content: [
64
+ {
65
+ type: 'text',
66
+ text: `No results found for query: "${args.query}"\n\nTry:\n${tips.map(t => `- ${t}`).join('\n')}`,
67
+ },
68
+ ],
69
+ };
70
+ }
71
+ const lines = [
72
+ `## Knowledge Base Results (${response.result_count} matches)`,
73
+ '',
74
+ `**Query:** "${args.query}"`,
75
+ ];
76
+ // Add filter info if any filters applied
77
+ const filters = [];
78
+ if (args.team_id)
79
+ filters.push(`Team ID: ${args.team_id}`);
80
+ if (args.category_id)
81
+ filters.push(`Category ID: ${args.category_id}`);
82
+ if (args.include_personal === false)
83
+ filters.push('Personal: excluded');
84
+ if (args.include_team === false)
85
+ filters.push('Team: excluded');
86
+ if (filters.length > 0) {
87
+ lines.push(`**Filters:** ${filters.join(', ')}`);
88
+ }
89
+ lines.push('');
90
+ // Track unique sources for citation
91
+ const sources = new Map();
92
+ for (let i = 0; i < response.results.length; i++) {
93
+ const result = response.results[i];
94
+ // Track source
95
+ sources.set(result.document_hash || result.document_title, {
96
+ title: result.document_title,
97
+ isTeam: result.is_team_document,
98
+ teamId: result.team_id ?? undefined,
99
+ });
100
+ // Calculate relevance indicator
101
+ let relevanceStr = '';
102
+ if (result.similarity !== null) {
103
+ const similarity = (result.similarity * 100).toFixed(0);
104
+ relevanceStr = ` (${similarity}% match)`;
105
+ }
106
+ else if (result.relevance !== null) {
107
+ relevanceStr = ` (relevance: ${result.relevance.toFixed(2)})`;
108
+ }
109
+ // Add team indicator if from team
110
+ const sourceLabel = result.is_team_document
111
+ ? `"${result.document_title}" [Team]`
112
+ : `"${result.document_title}"`;
113
+ lines.push(`### Result ${i + 1} from ${sourceLabel}${relevanceStr}`);
114
+ lines.push('');
115
+ // Show the content (truncate if very long)
116
+ const content = result.content.length > 2000
117
+ ? result.content.substring(0, 2000) + '... (truncated)'
118
+ : result.content;
119
+ lines.push(content);
120
+ lines.push('');
121
+ }
122
+ // Add sources footer
123
+ lines.push('---');
124
+ const personalSources = Array.from(sources.values()).filter(s => !s.isTeam);
125
+ const teamSources = Array.from(sources.values()).filter(s => s.isTeam);
126
+ if (personalSources.length > 0) {
127
+ lines.push(`**Personal Sources:** ${personalSources.map(s => s.title).join(', ')}`);
128
+ }
129
+ if (teamSources.length > 0) {
130
+ lines.push(`**Team Sources:** ${teamSources.map(s => s.title).join(', ')}`);
131
+ }
132
+ return {
133
+ content: [{ type: 'text', text: lines.join('\n') }],
134
+ };
135
+ }
136
+ catch (error) {
137
+ const message = error instanceof Error ? error.message : 'Unknown error';
138
+ return {
139
+ content: [{ type: 'text', text: `Error querying knowledge base: ${message}` }],
140
+ isError: true,
141
+ };
142
+ }
143
+ }
144
+ //# sourceMappingURL=query-knowledge-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-knowledge-base.js","sourceRoot":"","sources":["../../src/tools/query-knowledge-base.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,yBAAyB,GAAS;IAC7C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,0OAA0O;IAC5O,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qDAAqD;aACnE;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0GAA0G;aACxH;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,mEAAmE;aACjF;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,+DAA+D;aAC7E;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;gBAC7D,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,EAAE;aACZ;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,GAAqB,EACrB,IAOC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC;YAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,gBAAgB,EAAE,IAAI,CA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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9E,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,kCAAkC,OAAO,EAAE,EAAE,CAAC;YAC9E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * rename_app_file Tool
3
+ *
4
+ * Rename or move a file in a multi-file FlowDot app.
5
+ * Required scope: apps:manage
6
+ */
7
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
8
+ import { FlowDotApiClient } from '../api-client.js';
9
+ export declare const renameAppFileTool: Tool;
10
+ export declare function handleRenameAppFile(client: FlowDotApiClient, args: Record<string, unknown>): Promise<CallToolResult>;
11
+ //# sourceMappingURL=rename-app-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rename-app-file.d.ts","sourceRoot":"","sources":["../../src/tools/rename-app-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,EAAE,IA+B/B,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CA0BzB"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * rename_app_file Tool
3
+ *
4
+ * Rename or move a file in a multi-file FlowDot app.
5
+ * Required scope: apps:manage
6
+ */
7
+ export const renameAppFileTool = {
8
+ name: 'rename_app_file',
9
+ description: `Rename or move a file within a multi-file FlowDot app.
10
+
11
+ Changes the file's path while preserving its content. Can be used to:
12
+ - Rename a file (e.g., "Button.jsx" -> "PrimaryButton.jsx")
13
+ - Move to a different directory (e.g., "Button.jsx" -> "components/Button.jsx")
14
+ - Both rename and move at once
15
+
16
+ File constraints:
17
+ - Allowed extensions: jsx, js, tsx, ts, css, json, md
18
+ - No path traversal (../) allowed
19
+ - No hidden files (starting with .)`,
20
+ inputSchema: {
21
+ type: 'object',
22
+ properties: {
23
+ app_id: {
24
+ type: 'string',
25
+ description: 'The app ID (hash)',
26
+ },
27
+ file_path: {
28
+ type: 'string',
29
+ description: 'The current file path',
30
+ },
31
+ new_path: {
32
+ type: 'string',
33
+ description: 'The new file path',
34
+ },
35
+ },
36
+ required: ['app_id', 'file_path', 'new_path'],
37
+ },
38
+ };
39
+ export async function handleRenameAppFile(client, args) {
40
+ try {
41
+ const appId = String(args.app_id);
42
+ const filePath = String(args.file_path);
43
+ const newPath = String(args.new_path);
44
+ const result = await client.renameAppFile(appId, filePath, { new_path: newPath });
45
+ const text = `# File Renamed Successfully
46
+
47
+ **Old Path:** ${filePath}
48
+ **New Path:** ${result.path}
49
+ **App:** ${appId}
50
+
51
+ The file has been renamed/moved successfully.`;
52
+ return {
53
+ content: [{ type: 'text', text }],
54
+ };
55
+ }
56
+ catch (error) {
57
+ const message = error instanceof Error ? error.message : 'Unknown error';
58
+ return {
59
+ content: [{ type: 'text', text: `Error renaming app file: ${message}` }],
60
+ isError: true,
61
+ };
62
+ }
63
+ }
64
+ //# sourceMappingURL=rename-app-file.js.map
@@ -0,0 +1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AAK,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,4BAA4B,OAAO,EAAE,EAAE,CAAC;YACxE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Reprocess Document Tool
3
+ *
4
+ * Reprocesses a failed or pending document.
5
+ */
6
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import { FlowDotApiClient } from '../api-client.js';
8
+ export declare const reprocessDocumentToolDef: Tool;
9
+ export declare function handleReprocessDocument(api: FlowDotApiClient, args: {
10
+ document_id: number;
11
+ }): Promise<CallToolResult>;
12
+ //# sourceMappingURL=reprocess-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reprocess-document.d.ts","sourceRoot":"","sources":["../../src/tools/reprocess-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,wBAAwB,EAAE,IActC,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5B,OAAO,CAAC,cAAc,CAAC,CAmBzB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Reprocess Document Tool
3
+ *
4
+ * Reprocesses a failed or pending document.
5
+ */
6
+ export const reprocessDocumentToolDef = {
7
+ name: 'reprocess_document',
8
+ description: 'Reprocess a document that failed processing or is stuck in pending/processing status. Clears existing chunks and requeues for processing.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ document_id: {
13
+ type: 'number',
14
+ description: 'The ID of the document to reprocess',
15
+ },
16
+ },
17
+ required: ['document_id'],
18
+ },
19
+ };
20
+ export async function handleReprocessDocument(api, args) {
21
+ try {
22
+ await api.reprocessDocument(args.document_id);
23
+ return {
24
+ content: [
25
+ {
26
+ type: 'text',
27
+ text: `Document ${args.document_id} queued for reprocessing.\n\nUse list_knowledge_documents or get_knowledge_document to check the status.`,
28
+ },
29
+ ],
30
+ };
31
+ }
32
+ catch (error) {
33
+ const message = error instanceof Error ? error.message : 'Unknown error';
34
+ return {
35
+ content: [{ type: 'text', text: `Error reprocessing document: ${message}` }],
36
+ isError: true,
37
+ };
38
+ }
39
+ }
40
+ //# sourceMappingURL=reprocess-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reprocess-document.js","sourceRoot":"","sources":["../../src/tools/reprocess-document.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,wBAAwB,GAAS;IAC5C,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,2IAA2I;IAC7I,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,GAAqB,EACrB,IAA6B;IAE7B,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE9C,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,YAAY,IAAI,CAAC,WAAW,0GAA0G;iBAC7I;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,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,OAAO,EAAE,EAAE,CAAC;YAC5E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -6,10 +6,10 @@
6
6
  */
7
7
  export const searchAppsTool = {
8
8
  name: 'search_apps',
9
- description: `Search the FlowDot app marketplace for public apps created by other users.
10
-
11
- Apps are React frontend applications that can optionally use workflows as backends. You can search by keywords, filter by category/tag, and sort results.
12
-
9
+ description: `Search the FlowDot app marketplace for public apps created by other users.
10
+
11
+ Apps are React frontend applications that can optionally use workflows as backends. You can search by keywords, filter by category/tag, and sort results.
12
+
13
13
  Use this to discover reusable apps that can be cloned and customized.`,
14
14
  inputSchema: {
15
15
  type: 'object',
@@ -77,17 +77,17 @@ export async function handleSearchApps(client, args) {
77
77
  if (app.is_featured)
78
78
  badges.push('Featured');
79
79
  const badgeStr = badges.length ? ` (${badges.join(', ')})` : '';
80
- return `- **${app.name}** (${app.id})${badgeStr}
81
- By: ${app.user_name || 'Unknown'}
82
- ${app.description || 'No description'}
83
- Category: ${app.category || 'Uncategorized'} | Mobile: ${app.mobile_compatible ? 'Yes' : 'No'}
84
- Upvotes: ${app.upvotes} | Executions: ${app.execution_count} | Clones: ${app.clone_count}
80
+ return `- **${app.name}** (${app.id})${badgeStr}
81
+ By: ${app.user_name || 'Unknown'}
82
+ ${app.description || 'No description'}
83
+ Category: ${app.category || 'Uncategorized'} | Mobile: ${app.mobile_compatible ? 'Yes' : 'No'}
84
+ Upvotes: ${app.upvotes} | Executions: ${app.execution_count} | Clones: ${app.clone_count}
85
85
  ${tags ? `Tags: ${tags}` : ''}`;
86
86
  });
87
- const text = `Found ${result.total} public app(s) (page ${result.current_page}/${result.last_page}):
88
-
89
- ${appsInfo.join('\n\n')}
90
-
87
+ const text = `Found ${result.total} public app(s) (page ${result.current_page}/${result.last_page}):
88
+
89
+ ${appsInfo.join('\n\n')}
90
+
91
91
  Tip: Use get_app to see full details and code, or clone_app to copy to your library.`;
92
92
  return {
93
93
  content: [{ type: 'text', text }],
@@ -0,0 +1,14 @@
1
+ /**
2
+ * search MCP Tool
3
+ *
4
+ * A general-purpose search tool for FlowDot resources.
5
+ */
6
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import { FlowDotApiClient } from '../api-client.js';
8
+ export declare const searchTool: Tool;
9
+ export declare function handleSearch(api: FlowDotApiClient, args: {
10
+ query: string;
11
+ type?: 'workflow' | 'app' | 'custom_node';
12
+ page?: number;
13
+ }): Promise<CallToolResult>;
14
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQpD,eAAO,MAAM,UAAU,EAAE,IAuBxB,CAAC;AAEF,wBAAsB,YAAY,CAChC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,aAAa,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAChF,OAAO,CAAC,cAAc,CAAC,CA+DzB"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * search MCP Tool
3
+ *
4
+ * A general-purpose search tool for FlowDot resources.
5
+ */
6
+ export const searchTool = {
7
+ name: 'search',
8
+ description: 'Search for resources like workflows, apps, and custom nodes within the FlowDot platform.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ query: {
13
+ type: 'string',
14
+ description: 'Search query to match against resource name, description, or tags.',
15
+ },
16
+ type: {
17
+ type: 'string',
18
+ description: "Optional: The type of resource to search for. Can be 'workflow', 'app', or 'custom_node'. If omitted, all types are searched.",
19
+ enum: ['workflow', 'app', 'custom_node'],
20
+ },
21
+ page: {
22
+ type: 'number',
23
+ description: 'Page number for pagination.',
24
+ default: 1,
25
+ },
26
+ },
27
+ required: ['query'],
28
+ },
29
+ };
30
+ export async function handleSearch(api, args) {
31
+ const { query, type, page = 1 } = args;
32
+ try {
33
+ const searchPromises = [];
34
+ const typesToSearch = [];
35
+ if (!type || type === 'workflow') {
36
+ searchPromises.push(api.searchWorkflows(query, undefined, page));
37
+ typesToSearch.push('workflow');
38
+ }
39
+ if (!type || type === 'app') {
40
+ searchPromises.push(api.searchPublicApps({ q: query, page }));
41
+ typesToSearch.push('app');
42
+ }
43
+ if (!type || type === 'custom_node') {
44
+ searchPromises.push(api.searchPublicCustomNodes({ q: query, page }));
45
+ typesToSearch.push('custom_node');
46
+ }
47
+ const results = await Promise.allSettled(searchPromises);
48
+ let lines = [];
49
+ let totalResults = 0;
50
+ results.forEach((result, index) => {
51
+ if (result.status === 'fulfilled') {
52
+ const paginatedResult = result.value;
53
+ const items = Array.isArray(paginatedResult?.data) ? paginatedResult.data : [];
54
+ if (items.length > 0) {
55
+ const resourceType = typesToSearch[index];
56
+ lines.push(`### ${resourceType.charAt(0).toUpperCase() + resourceType.slice(1)}s`);
57
+ items.forEach(item => {
58
+ const visibility = ('is_public' in item && item.is_public) ? ' (public)' : '';
59
+ const desc = item.description ? ` - ${item.description}` : '';
60
+ lines.push(`- **${item.name}** (${item.id})${visibility}${desc}`);
61
+ });
62
+ lines.push('');
63
+ totalResults += items.length;
64
+ }
65
+ }
66
+ });
67
+ if (totalResults === 0) {
68
+ return {
69
+ content: [{ type: 'text', text: `No results found for "${query}".` }],
70
+ };
71
+ }
72
+ const header = `## Search Results for "${query}" (Page ${page})`;
73
+ lines.unshift(header, '');
74
+ return {
75
+ content: [{ type: 'text', text: lines.join('\n') }],
76
+ };
77
+ }
78
+ catch (error) {
79
+ const message = error instanceof Error ? error.message : 'Unknown error';
80
+ return {
81
+ content: [{ type: 'text', text: `Error during search: ${message}` }],
82
+ isError: true,
83
+ };
84
+ }
85
+ }
86
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,0FAA0F;IACvG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oEAAoE;aAClF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+HAA+H;gBAC5I,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,aAAa,CAAC;aACzC;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;gBAC1C,OAAO,EAAE,CAAC;aACX;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAqB,EACrB,IAAiF;IAEjF,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;IAEvC,IAAI,CAAC;QACH,MAAM,cAAc,GAA4D,EAAE,CAAC;QACnF,MAAM,aAAa,GAA2C,EAAE,CAAC;QAEjE,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YACjC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;YACjE,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjC,C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AAO,EAAE,EAAE,CAAC;YACpE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * set_app_entry_file Tool
3
+ *
4
+ * Set a file as the entry point for a multi-file FlowDot app.
5
+ * Required scope: apps:manage
6
+ */
7
+ import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
8
+ import { FlowDotApiClient } from '../api-client.js';
9
+ export declare const setAppEntryFileTool: Tool;
10
+ export declare function handleSetAppEntryFile(client: FlowDotApiClient, args: Record<string, unknown>): Promise<CallToolResult>;
11
+ //# sourceMappingURL=set-app-entry-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-app-entry-file.d.ts","sourceRoot":"","sources":["../../src/tools/set-app-entry-file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,mBAAmB,EAAE,IAyBjC,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAwBzB"}