@hailer/mcp 0.0.1

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 (163) hide show
  1. package/.claude/commands/tool-builder.md +37 -0
  2. package/.claude/commands/ws-pull.md +44 -0
  3. package/.claude/settings.json +8 -0
  4. package/.claude/settings.local.json +49 -0
  5. package/.claude/skills/activity-api/SKILL.md +96 -0
  6. package/.claude/skills/activity-api/references/activity-endpoints.md +845 -0
  7. package/.claude/skills/add-app-member-skill/SKILL.md +977 -0
  8. package/.claude/skills/agent-building/SKILL.md +243 -0
  9. package/.claude/skills/agent-building/references/architecture-patterns.md +446 -0
  10. package/.claude/skills/agent-building/references/code-examples.md +587 -0
  11. package/.claude/skills/agent-building/references/implementation-guide.md +619 -0
  12. package/.claude/skills/app-api/SKILL.md +219 -0
  13. package/.claude/skills/app-api/references/app-endpoints.md +759 -0
  14. package/.claude/skills/building-hailer-apps-skill/SKILL.md +548 -0
  15. package/.claude/skills/create-app-skill/SKILL.md +1101 -0
  16. package/.claude/skills/create-insight-skill/SKILL.md +1317 -0
  17. package/.claude/skills/get-insight-data-skill/SKILL.md +1053 -0
  18. package/.claude/skills/hailer-api/SKILL.md +283 -0
  19. package/.claude/skills/hailer-api/references/activities.md +620 -0
  20. package/.claude/skills/hailer-api/references/authentication.md +216 -0
  21. package/.claude/skills/hailer-api/references/datasets.md +437 -0
  22. package/.claude/skills/hailer-api/references/files.md +301 -0
  23. package/.claude/skills/hailer-api/references/insights.md +469 -0
  24. package/.claude/skills/hailer-api/references/workflows.md +720 -0
  25. package/.claude/skills/hailer-api/references/workspaces-users.md +445 -0
  26. package/.claude/skills/insight-api/SKILL.md +185 -0
  27. package/.claude/skills/insight-api/references/insight-endpoints.md +514 -0
  28. package/.claude/skills/install-workflow-skill/SKILL.md +1056 -0
  29. package/.claude/skills/list-apps-skill/SKILL.md +1010 -0
  30. package/.claude/skills/list-workflows-minimal-skill/SKILL.md +992 -0
  31. package/.claude/skills/local-first-skill/SKILL.md +570 -0
  32. package/.claude/skills/mcp-tools/SKILL.md +419 -0
  33. package/.claude/skills/mcp-tools/references/api-endpoints.md +499 -0
  34. package/.claude/skills/mcp-tools/references/data-structures.md +554 -0
  35. package/.claude/skills/mcp-tools/references/implementation-patterns.md +717 -0
  36. package/.claude/skills/preview-insight-skill/SKILL.md +1290 -0
  37. package/.claude/skills/publish-hailer-app-skill/SKILL.md +453 -0
  38. package/.claude/skills/remove-app-member-skill/SKILL.md +671 -0
  39. package/.claude/skills/remove-app-skill/SKILL.md +985 -0
  40. package/.claude/skills/remove-insight-skill/SKILL.md +1011 -0
  41. package/.claude/skills/remove-workflow-skill/SKILL.md +920 -0
  42. package/.claude/skills/scaffold-hailer-app-skill/SKILL.md +1034 -0
  43. package/.claude/skills/skill-testing/README.md +137 -0
  44. package/.claude/skills/skill-testing/SKILL.md +348 -0
  45. package/.claude/skills/skill-testing/references/test-patterns.md +705 -0
  46. package/.claude/skills/skill-testing/references/testing-guide.md +603 -0
  47. package/.claude/skills/skill-testing/references/validation-checklist.md +537 -0
  48. package/.claude/skills/tool-builder/SKILL.md +328 -0
  49. package/.claude/skills/update-app-skill/SKILL.md +970 -0
  50. package/.claude/skills/update-workflow-field-skill/SKILL.md +1098 -0
  51. package/.env.example +81 -0
  52. package/.mcp.json +13 -0
  53. package/README.md +297 -0
  54. package/dist/app.d.ts +4 -0
  55. package/dist/app.js +74 -0
  56. package/dist/cli.d.ts +3 -0
  57. package/dist/cli.js +5 -0
  58. package/dist/client/adaptive-documentation-bot.d.ts +108 -0
  59. package/dist/client/adaptive-documentation-bot.js +475 -0
  60. package/dist/client/adaptive-documentation-types.d.ts +66 -0
  61. package/dist/client/adaptive-documentation-types.js +9 -0
  62. package/dist/client/agent-activity-bot.d.ts +51 -0
  63. package/dist/client/agent-activity-bot.js +166 -0
  64. package/dist/client/agent-tracker.d.ts +499 -0
  65. package/dist/client/agent-tracker.js +659 -0
  66. package/dist/client/description-updater.d.ts +56 -0
  67. package/dist/client/description-updater.js +259 -0
  68. package/dist/client/log-parser.d.ts +72 -0
  69. package/dist/client/log-parser.js +387 -0
  70. package/dist/client/mcp-client.d.ts +50 -0
  71. package/dist/client/mcp-client.js +532 -0
  72. package/dist/client/message-processor.d.ts +35 -0
  73. package/dist/client/message-processor.js +352 -0
  74. package/dist/client/multi-bot-manager.d.ts +24 -0
  75. package/dist/client/multi-bot-manager.js +74 -0
  76. package/dist/client/providers/anthropic-provider.d.ts +19 -0
  77. package/dist/client/providers/anthropic-provider.js +631 -0
  78. package/dist/client/providers/llm-provider.d.ts +47 -0
  79. package/dist/client/providers/llm-provider.js +367 -0
  80. package/dist/client/providers/openai-provider.d.ts +23 -0
  81. package/dist/client/providers/openai-provider.js +621 -0
  82. package/dist/client/simple-llm-caller.d.ts +19 -0
  83. package/dist/client/simple-llm-caller.js +100 -0
  84. package/dist/client/skill-generator.d.ts +81 -0
  85. package/dist/client/skill-generator.js +386 -0
  86. package/dist/client/test-adaptive-bot.d.ts +9 -0
  87. package/dist/client/test-adaptive-bot.js +82 -0
  88. package/dist/client/token-pricing.d.ts +38 -0
  89. package/dist/client/token-pricing.js +127 -0
  90. package/dist/client/token-tracker.d.ts +232 -0
  91. package/dist/client/token-tracker.js +457 -0
  92. package/dist/client/token-usage-bot.d.ts +53 -0
  93. package/dist/client/token-usage-bot.js +153 -0
  94. package/dist/client/tool-executor.d.ts +69 -0
  95. package/dist/client/tool-executor.js +159 -0
  96. package/dist/client/tool-schema-loader.d.ts +60 -0
  97. package/dist/client/tool-schema-loader.js +178 -0
  98. package/dist/client/types.d.ts +69 -0
  99. package/dist/client/types.js +7 -0
  100. package/dist/config.d.ts +162 -0
  101. package/dist/config.js +296 -0
  102. package/dist/core.d.ts +26 -0
  103. package/dist/core.js +147 -0
  104. package/dist/lib/context-manager.d.ts +111 -0
  105. package/dist/lib/context-manager.js +431 -0
  106. package/dist/lib/logger.d.ts +74 -0
  107. package/dist/lib/logger.js +277 -0
  108. package/dist/lib/materialize.d.ts +3 -0
  109. package/dist/lib/materialize.js +101 -0
  110. package/dist/lib/normalizedName.d.ts +7 -0
  111. package/dist/lib/normalizedName.js +48 -0
  112. package/dist/lib/prompt-length-manager.d.ts +81 -0
  113. package/dist/lib/prompt-length-manager.js +457 -0
  114. package/dist/lib/terminal-prompt.d.ts +9 -0
  115. package/dist/lib/terminal-prompt.js +108 -0
  116. package/dist/mcp/UserContextCache.d.ts +56 -0
  117. package/dist/mcp/UserContextCache.js +163 -0
  118. package/dist/mcp/auth.d.ts +2 -0
  119. package/dist/mcp/auth.js +29 -0
  120. package/dist/mcp/hailer-clients.d.ts +42 -0
  121. package/dist/mcp/hailer-clients.js +246 -0
  122. package/dist/mcp/signal-handler.d.ts +45 -0
  123. package/dist/mcp/signal-handler.js +317 -0
  124. package/dist/mcp/tool-registry.d.ts +100 -0
  125. package/dist/mcp/tool-registry.js +306 -0
  126. package/dist/mcp/tools/activity.d.ts +15 -0
  127. package/dist/mcp/tools/activity.js +955 -0
  128. package/dist/mcp/tools/app.d.ts +20 -0
  129. package/dist/mcp/tools/app.js +1488 -0
  130. package/dist/mcp/tools/discussion.d.ts +19 -0
  131. package/dist/mcp/tools/discussion.js +950 -0
  132. package/dist/mcp/tools/file.d.ts +15 -0
  133. package/dist/mcp/tools/file.js +119 -0
  134. package/dist/mcp/tools/insight.d.ts +17 -0
  135. package/dist/mcp/tools/insight.js +806 -0
  136. package/dist/mcp/tools/skill.d.ts +10 -0
  137. package/dist/mcp/tools/skill.js +279 -0
  138. package/dist/mcp/tools/user.d.ts +10 -0
  139. package/dist/mcp/tools/user.js +108 -0
  140. package/dist/mcp/tools/workflow-template.d.ts +19 -0
  141. package/dist/mcp/tools/workflow-template.js +822 -0
  142. package/dist/mcp/tools/workflow.d.ts +18 -0
  143. package/dist/mcp/tools/workflow.js +1362 -0
  144. package/dist/mcp/utils/api-errors.d.ts +45 -0
  145. package/dist/mcp/utils/api-errors.js +160 -0
  146. package/dist/mcp/utils/data-transformers.d.ts +102 -0
  147. package/dist/mcp/utils/data-transformers.js +194 -0
  148. package/dist/mcp/utils/file-upload.d.ts +33 -0
  149. package/dist/mcp/utils/file-upload.js +148 -0
  150. package/dist/mcp/utils/hailer-api-client.d.ts +120 -0
  151. package/dist/mcp/utils/hailer-api-client.js +323 -0
  152. package/dist/mcp/utils/index.d.ts +13 -0
  153. package/dist/mcp/utils/index.js +39 -0
  154. package/dist/mcp/utils/logger.d.ts +42 -0
  155. package/dist/mcp/utils/logger.js +103 -0
  156. package/dist/mcp/utils/types.d.ts +286 -0
  157. package/dist/mcp/utils/types.js +7 -0
  158. package/dist/mcp/workspace-cache.d.ts +42 -0
  159. package/dist/mcp/workspace-cache.js +97 -0
  160. package/dist/mcp-server.d.ts +42 -0
  161. package/dist/mcp-server.js +280 -0
  162. package/package.json +56 -0
  163. package/tsconfig.json +23 -0
@@ -0,0 +1,992 @@
1
+ ---
2
+ name: list-workflows-minimal-skill
3
+ description: Complete guide to using the list_workflows_minimal tool to efficiently list workflows with minimal output to avoid token limits
4
+ ---
5
+
6
+ # List Workflows Minimal Skill
7
+
8
+ Complete guide to using the `list_workflows_minimal` tool to efficiently list workflows with minimal output, perfect for finding workflows by name or avoiding token limits.
9
+
10
+ ## Table of Contents
11
+ - [Quick Reference](#quick-reference)
12
+ - [Overview](#overview)
13
+ - [Core Concepts](#core-concepts)
14
+ - [Basic Usage](#basic-usage)
15
+ - [Filtering and Search](#filtering-and-search)
16
+ - [Pagination](#pagination)
17
+ - [Common Scenarios](#common-scenarios)
18
+ - [Best Practices](#best-practices)
19
+ - [Troubleshooting](#troubleshooting)
20
+ - [Integration with Other Tools](#integration-with-other-tools)
21
+ - [Additional Resources](#additional-resources)
22
+
23
+ ## Quick Reference
24
+
25
+ ### List all workflows (minimal output)
26
+ ```javascript
27
+ list_workflows_minimal()
28
+ ```
29
+
30
+ ### Search workflows by name
31
+ ```javascript
32
+ list_workflows_minimal({
33
+ search: "task"
34
+ })
35
+ ```
36
+
37
+ ### List starred workflows only
38
+ ```javascript
39
+ list_workflows_minimal({
40
+ starredOnly: true
41
+ })
42
+ ```
43
+
44
+ ### Paginate results (first 10)
45
+ ```javascript
46
+ list_workflows_minimal({
47
+ limit: 10,
48
+ offset: 0
49
+ })
50
+ ```
51
+
52
+ ### Combine filters
53
+ ```javascript
54
+ list_workflows_minimal({
55
+ search: "customer",
56
+ starredOnly: true,
57
+ limit: 20
58
+ })
59
+ ```
60
+
61
+ ## Overview
62
+
63
+ The `list_workflows_minimal` tool lists workflows with minimal output (only id, name, workspace, activity count, and starred status). This is designed to avoid token limits when you have many workflows or just need to find specific workflows without loading full schema details.
64
+
65
+ **Key capabilities:**
66
+ - Lists workflows with minimal data (id, name, count, starred)
67
+ - Avoids token limits (unlike full workflow listing)
68
+ - Search workflows by name (case-insensitive)
69
+ - Filter by starred workflows
70
+ - Pagination support (limit and offset)
71
+ - Filter by workspace
72
+
73
+ **What you get:**
74
+ - Workflow ID
75
+ - Workflow name
76
+ - Workspace ID
77
+ - Activity count
78
+ - Starred status
79
+
80
+ **What you DON'T get:**
81
+ - Fields
82
+ - Phases
83
+ - Activity links
84
+ - Permissions
85
+ - Full schema details
86
+
87
+ **When to use this tool:**
88
+ - Finding a workflow by name
89
+ - Getting a quick list of all workflows
90
+ - Working with workspaces that have many workflows (50+)
91
+ - Avoiding token limits
92
+ - Checking if a workflow exists
93
+
94
+ **When to use full listing instead:**
95
+ - Need field information
96
+ - Need phase information
97
+ - Need to analyze workflow structure
98
+ - Working with few workflows (<20)
99
+
100
+ ## Core Concepts
101
+
102
+ ### Minimal Output
103
+
104
+ This tool returns only essential information:
105
+
106
+ ```javascript
107
+ {
108
+ id: "_0001",
109
+ name: "Tasks",
110
+ workspaceId: "workspace-id",
111
+ activityCount: 150,
112
+ isStarred: true
113
+ }
114
+ ```
115
+
116
+ **vs full workflow listing:**
117
+ ```javascript
118
+ {
119
+ id: "_0001",
120
+ name: "Tasks",
121
+ workspaceId: "workspace-id",
122
+ activityCount: 150,
123
+ isStarred: true,
124
+ fields: [...], // 20-50 fields
125
+ phases: [...], // 5-10 phases
126
+ activityLinks: [...], // 0-10 links
127
+ permissions: {...}, // Permission details
128
+ // ... and more
129
+ }
130
+ ```
131
+
132
+ ### Token Optimization
133
+
134
+ **Problem:** Full workflow listing can use 10,000+ tokens with many workflows.
135
+
136
+ **Solution:** Minimal listing uses ~100-500 tokens for the same data.
137
+
138
+ **Example:**
139
+ - 100 workflows with full data: ~50,000 tokens
140
+ - 100 workflows with minimal data: ~2,000 tokens
141
+
142
+ ### Search and Filtering
143
+
144
+ Four ways to filter workflows:
145
+
146
+ 1. **By name** - Case-insensitive partial match
147
+ 2. **By starred** - Only show starred workflows
148
+ 3. **By workspace** - Filter to specific workspace
149
+ 4. **By pagination** - Limit results and skip entries
150
+
151
+ ### Pagination
152
+
153
+ Control output size:
154
+ - **limit** - Max number to return
155
+ - **offset** - Number to skip
156
+
157
+ **Example:**
158
+ ```javascript
159
+ // Page 1: First 20
160
+ list_workflows_minimal({ limit: 20, offset: 0 })
161
+
162
+ // Page 2: Next 20
163
+ list_workflows_minimal({ limit: 20, offset: 20 })
164
+
165
+ // Page 3: Next 20
166
+ list_workflows_minimal({ limit: 20, offset: 40 })
167
+ ```
168
+
169
+ ## Basic Usage
170
+
171
+ ### List all workflows
172
+
173
+ ```javascript
174
+ list_workflows_minimal()
175
+ ```
176
+
177
+ **Output:**
178
+ ```
179
+ 📋 Workflows Found
180
+
181
+ Total: 25
182
+ Showing: 25
183
+
184
+ ⭐ **Tasks**
185
+ ID: `_0001`
186
+ Activities: 150
187
+
188
+ **Projects**
189
+ ID: `_0002`
190
+ Activities: 48
191
+
192
+ **Customers**
193
+ ID: `_0003`
194
+ Activities: 203
195
+
196
+ 💡 Next Steps:
197
+ - Use `get_workflow_schema` with workflow ID to see fields
198
+ ```
199
+
200
+ ### Get first 10 workflows
201
+
202
+ ```javascript
203
+ list_workflows_minimal({
204
+ limit: 10
205
+ })
206
+ ```
207
+
208
+ **Output:**
209
+ ```
210
+ 📋 Workflows Found
211
+
212
+ Total: 25
213
+ Showing: 10
214
+
215
+ ⭐ **Tasks**
216
+ ID: `_0001`
217
+ Activities: 150
218
+
219
+ **Projects**
220
+ ID: `_0002`
221
+ Activities: 48
222
+
223
+ ...
224
+ (8 more workflows)
225
+ ```
226
+
227
+ ## Filtering and Search
228
+
229
+ ### Search by name
230
+
231
+ ```javascript
232
+ // Find workflows with "task" in name
233
+ list_workflows_minimal({
234
+ search: "task"
235
+ })
236
+ ```
237
+
238
+ **Matches:**
239
+ - "Tasks"
240
+ - "Task Manager"
241
+ - "Project Tasks"
242
+ - "Subtasks"
243
+
244
+ **Case-insensitive** - Searches both "task", "Task", "TASK"
245
+
246
+ ### Show only starred workflows
247
+
248
+ ```javascript
249
+ list_workflows_minimal({
250
+ starredOnly: true
251
+ })
252
+ ```
253
+
254
+ **Output:**
255
+ ```
256
+ 📋 Workflows Found
257
+
258
+ Total: 3
259
+ Showing: 3
260
+
261
+ ⭐ **Tasks**
262
+ ID: `_0001`
263
+ Activities: 150
264
+
265
+ ⭐ **Projects**
266
+ ID: `_0002`
267
+ Activities: 48
268
+
269
+ ⭐ **Customers**
270
+ ID: `_0003`
271
+ Activities: 203
272
+ ```
273
+
274
+ ### Filter by workspace
275
+
276
+ ```javascript
277
+ list_workflows_minimal({
278
+ workspace: "workspace-id"
279
+ // or workspace: "Workspace Name"
280
+ })
281
+ ```
282
+
283
+ ### Combine filters
284
+
285
+ ```javascript
286
+ // Find starred workflows with "customer" in name
287
+ list_workflows_minimal({
288
+ search: "customer",
289
+ starredOnly: true
290
+ })
291
+ ```
292
+
293
+ ## Pagination
294
+
295
+ ### Basic pagination
296
+
297
+ ```javascript
298
+ // First page: 10 workflows
299
+ list_workflows_minimal({
300
+ limit: 10,
301
+ offset: 0
302
+ })
303
+
304
+ // Second page: Next 10 workflows
305
+ list_workflows_minimal({
306
+ limit: 10,
307
+ offset: 10
308
+ })
309
+
310
+ // Third page: Next 10 workflows
311
+ list_workflows_minimal({
312
+ limit: 10,
313
+ offset: 20
314
+ })
315
+ ```
316
+
317
+ ### Skip first N workflows
318
+
319
+ ```javascript
320
+ // Skip first 5, show rest
321
+ list_workflows_minimal({
322
+ offset: 5
323
+ })
324
+ ```
325
+
326
+ ### Combine pagination with search
327
+
328
+ ```javascript
329
+ // First 20 workflows matching "task"
330
+ list_workflows_minimal({
331
+ search: "task",
332
+ limit: 20,
333
+ offset: 0
334
+ })
335
+ ```
336
+
337
+ ### Large workspace strategy
338
+
339
+ For workspaces with 100+ workflows:
340
+
341
+ ```javascript
342
+ // Get first batch
343
+ const page1 = list_workflows_minimal({
344
+ limit: 50,
345
+ offset: 0
346
+ })
347
+
348
+ // Get second batch
349
+ const page2 = list_workflows_minimal({
350
+ limit: 50,
351
+ offset: 50
352
+ })
353
+
354
+ // Get remaining
355
+ const page3 = list_workflows_minimal({
356
+ limit: 50,
357
+ offset: 100
358
+ })
359
+ ```
360
+
361
+ ## Common Scenarios
362
+
363
+ ### Scenario 1: Find Specific Workflow by Name
364
+
365
+ You know the workflow name but not the ID:
366
+
367
+ ```javascript
368
+ // Find "Tasks" workflow
369
+ list_workflows_minimal({
370
+ search: "tasks"
371
+ })
372
+ ```
373
+
374
+ **Result:**
375
+ ```
376
+ 📋 Workflows Found
377
+
378
+ Total: 1
379
+ Showing: 1
380
+
381
+ ⭐ **Tasks**
382
+ ID: `_0001`
383
+ Activities: 150
384
+ ```
385
+
386
+ **Next:** Use the ID to get full schema:
387
+ ```javascript
388
+ get_workflow_schema({
389
+ workflowId: "_0001"
390
+ })
391
+ ```
392
+
393
+ ### Scenario 2: Quick Inventory of All Workflows
394
+
395
+ Get overview without overwhelming token usage:
396
+
397
+ ```javascript
398
+ list_workflows_minimal()
399
+ ```
400
+
401
+ **Use case:**
402
+ - New workspace exploration
403
+ - Documenting existing workflows
404
+ - Understanding workspace structure
405
+ - Generating workflow reports
406
+
407
+ ### Scenario 3: Find Unused Workflows
408
+
409
+ Identify workflows with zero activities:
410
+
411
+ ```javascript
412
+ // List all workflows
413
+ const workflows = list_workflows_minimal()
414
+
415
+ // Filter output manually for activityCount: 0
416
+ // Or look through the list for workflows with 0 activities
417
+ ```
418
+
419
+ **Example output showing unused workflow:**
420
+ ```
421
+ **Legacy System**
422
+ ID: `_0015`
423
+ Activities: 0 ← Unused workflow
424
+ ```
425
+
426
+ ### Scenario 4: Working with Large Workspaces
427
+
428
+ Workspace with 200+ workflows - avoid token limits:
429
+
430
+ ```javascript
431
+ // ❌ Bad: Full listing could exceed token limits
432
+ // get_all_workflows() // 50,000+ tokens
433
+
434
+ // ✅ Good: Minimal listing
435
+ list_workflows_minimal({
436
+ limit: 50 // Manageable chunks
437
+ })
438
+ ```
439
+
440
+ ### Scenario 5: Find Related Workflows
441
+
442
+ Search for workflow family:
443
+
444
+ ```javascript
445
+ // Find all HR-related workflows
446
+ list_workflows_minimal({
447
+ search: "hr"
448
+ })
449
+ ```
450
+
451
+ **Matches:**
452
+ - "HR Onboarding"
453
+ - "HR Requests"
454
+ - "HR Documents"
455
+ - "Employee HR Records"
456
+
457
+ ### Scenario 6: Interactive Workflow Selection
458
+
459
+ Build a workflow picker for users:
460
+
461
+ ```javascript
462
+ // 1. Get all workflows
463
+ const all = list_workflows_minimal()
464
+
465
+ // 2. Let user search
466
+ const filtered = list_workflows_minimal({
467
+ search: userInput
468
+ })
469
+
470
+ // 3. User selects from filtered list
471
+ // 4. Get full schema for selected workflow
472
+ get_workflow_schema({
473
+ workflowId: selectedId
474
+ })
475
+ ```
476
+
477
+ ### Scenario 7: Audit Workflow Usage
478
+
479
+ Generate usage report:
480
+
481
+ ```javascript
482
+ // Get all workflows with activity counts
483
+ list_workflows_minimal()
484
+
485
+ // Analyze output:
486
+ // - Which workflows are most used? (high activity count)
487
+ // - Which are unused? (activity count: 0)
488
+ // - Which are starred? (important workflows)
489
+ ```
490
+
491
+ ### Scenario 8: Paginated Browse Experience
492
+
493
+ Implement "load more" pattern:
494
+
495
+ ```javascript
496
+ let offset = 0;
497
+ const pageSize = 20;
498
+
499
+ // Load first page
500
+ list_workflows_minimal({
501
+ limit: pageSize,
502
+ offset: offset
503
+ })
504
+
505
+ // User clicks "load more"
506
+ offset += pageSize;
507
+
508
+ // Load next page
509
+ list_workflows_minimal({
510
+ limit: pageSize,
511
+ offset: offset
512
+ })
513
+ ```
514
+
515
+ ## Best Practices
516
+
517
+ ### 1. Use Minimal Listing for Large Workspaces
518
+
519
+ ```javascript
520
+ // ❌ Avoid: Full listing when you have many workflows
521
+ // get_all_workflows() // Could use 50,000 tokens
522
+
523
+ // ✅ Better: Minimal listing
524
+ list_workflows_minimal({
525
+ limit: 50
526
+ })
527
+ ```
528
+
529
+ ### 2. Search Before Loading Full Schema
530
+
531
+ ```javascript
532
+ // Efficient workflow:
533
+
534
+ // 1. Find workflow by name (minimal tokens)
535
+ list_workflows_minimal({
536
+ search: "customers"
537
+ })
538
+
539
+ // 2. Get ID from results: "_0003"
540
+
541
+ // 3. Only then load full schema (more tokens)
542
+ get_workflow_schema({
543
+ workflowId: "_0003"
544
+ })
545
+ ```
546
+
547
+ ### 3. Use Starred Filter for Important Workflows
548
+
549
+ ```javascript
550
+ // Show only important/frequently used workflows
551
+ list_workflows_minimal({
552
+ starredOnly: true
553
+ })
554
+ ```
555
+
556
+ ### 4. Paginate for Better Performance
557
+
558
+ ```javascript
559
+ // Better performance with pagination
560
+ list_workflows_minimal({
561
+ limit: 25 // Manageable chunk size
562
+ })
563
+
564
+ // vs loading all 200 workflows at once
565
+ list_workflows_minimal() // Could be slow
566
+ ```
567
+
568
+ ### 5. Case-Insensitive Search
569
+
570
+ ```javascript
571
+ // All equivalent:
572
+ list_workflows_minimal({ search: "task" })
573
+ list_workflows_minimal({ search: "Task" })
574
+ list_workflows_minimal({ search: "TASK" })
575
+
576
+ // Use lowercase for consistency
577
+ list_workflows_minimal({ search: "task" })
578
+ ```
579
+
580
+ ### 6. Combine Filters Strategically
581
+
582
+ ```javascript
583
+ // Narrow down efficiently
584
+ list_workflows_minimal({
585
+ search: "project", // Match name
586
+ starredOnly: true, // Only important ones
587
+ limit: 10 // First 10 results
588
+ })
589
+ ```
590
+
591
+ ### 7. Document Workflow IDs
592
+
593
+ After finding workflows, document them:
594
+
595
+ ```javascript
596
+ // Find key workflows once
597
+ const tasks = list_workflows_minimal({ search: "tasks" })
598
+ // ID: "_0001"
599
+
600
+ const projects = list_workflows_minimal({ search: "projects" })
601
+ // ID: "_0002"
602
+
603
+ // Document in code comments or config:
604
+ const WORKFLOW_IDS = {
605
+ TASKS: "_0001",
606
+ PROJECTS: "_0002"
607
+ };
608
+ ```
609
+
610
+ ## Troubleshooting
611
+
612
+ ### No Workflows Found
613
+
614
+ **Problem:** Empty results.
615
+
616
+ **Possible causes:**
617
+ 1. No workflows in workspace
618
+ 2. Search term too specific
619
+ 3. starredOnly: true but no starred workflows
620
+ 4. Workspace filter excluding all workflows
621
+
622
+ **Solution:**
623
+ ```javascript
624
+ // 1. Try without filters
625
+ list_workflows_minimal()
626
+
627
+ // 2. Broaden search
628
+ list_workflows_minimal({
629
+ search: "a" // More general search
630
+ })
631
+
632
+ // 3. Remove starredOnly filter
633
+ list_workflows_minimal({
634
+ starredOnly: false
635
+ })
636
+ ```
637
+
638
+ ### Search Returns Nothing
639
+
640
+ **Problem:** No results for search term.
641
+
642
+ **Solution:**
643
+ ```javascript
644
+ // Try partial matches
645
+ list_workflows_minimal({ search: "task" }) // Broader
646
+ // vs
647
+ list_workflows_minimal({ search: "task manager v2" }) // Too specific
648
+
649
+ // Try different terms
650
+ list_workflows_minimal({ search: "project" })
651
+ list_workflows_minimal({ search: "customer" })
652
+ ```
653
+
654
+ ### Too Many Results
655
+
656
+ **Problem:** Hundreds of workflows returned.
657
+
658
+ **Solution:**
659
+ ```javascript
660
+ // Use pagination
661
+ list_workflows_minimal({
662
+ limit: 25,
663
+ offset: 0
664
+ })
665
+
666
+ // Or use more specific search
667
+ list_workflows_minimal({
668
+ search: "customer service" // More specific
669
+ })
670
+
671
+ // Or filter to starred only
672
+ list_workflows_minimal({
673
+ starredOnly: true
674
+ })
675
+ ```
676
+
677
+ ### Need Full Schema After Minimal List
678
+
679
+ **Problem:** Need field details after finding workflow.
680
+
681
+ **Solution:**
682
+ ```javascript
683
+ // 1. Find workflow
684
+ const result = list_workflows_minimal({
685
+ search: "tasks"
686
+ })
687
+ // Found: ID "_0001"
688
+
689
+ // 2. Get full schema
690
+ get_workflow_schema({
691
+ workflowId: "_0001"
692
+ })
693
+ ```
694
+
695
+ ### Offset Beyond Total Count
696
+
697
+ **Problem:** Offset larger than total workflows.
698
+
699
+ **Example:**
700
+ ```javascript
701
+ // Only 50 workflows exist
702
+ list_workflows_minimal({
703
+ limit: 20,
704
+ offset: 100 // Beyond total count
705
+ })
706
+ ```
707
+
708
+ **Result:** Empty results.
709
+
710
+ **Solution:**
711
+ ```javascript
712
+ // Check total count first
713
+ list_workflows_minimal({ limit: 1 })
714
+ // Shows: "Total: 50"
715
+
716
+ // Then use appropriate offset
717
+ list_workflows_minimal({
718
+ limit: 20,
719
+ offset: 40 // Within range
720
+ })
721
+ ```
722
+
723
+ ### Starred Filter Returns Nothing
724
+
725
+ **Problem:** starredOnly: true returns no workflows.
726
+
727
+ **Cause:** No workflows are starred in the workspace.
728
+
729
+ **Solution:**
730
+ ```javascript
731
+ // Remove starred filter
732
+ list_workflows_minimal()
733
+
734
+ // Or star important workflows in Hailer UI first
735
+ ```
736
+
737
+ ## Integration with Other Tools
738
+
739
+ ### With `get_workflow_schema`
740
+
741
+ Find workflow first, then get details:
742
+
743
+ ```javascript
744
+ // 1. Find workflow ID (minimal tokens)
745
+ list_workflows_minimal({
746
+ search: "customers"
747
+ })
748
+
749
+ // Result shows: ID "_0003"
750
+
751
+ // 2. Get full schema (more tokens)
752
+ get_workflow_schema({
753
+ workflowId: "_0003"
754
+ })
755
+ ```
756
+
757
+ ### With `install_workflow`
758
+
759
+ Check if workflow name already exists:
760
+
761
+ ```javascript
762
+ // Before creating new workflow, check if name exists
763
+ list_workflows_minimal({
764
+ search: "tasks"
765
+ })
766
+
767
+ // If no match, safe to create:
768
+ install_workflow({
769
+ id: '_0010',
770
+ name: 'Tasks',
771
+ fields: [...]
772
+ })
773
+ ```
774
+
775
+ ### With `remove_workflow`
776
+
777
+ Find workflow to remove:
778
+
779
+ ```javascript
780
+ // 1. Find unused workflow
781
+ list_workflows_minimal()
782
+
783
+ // Output shows:
784
+ // **Old System**
785
+ // ID: `_0015`
786
+ // Activities: 0 ← Unused
787
+
788
+ // 2. Remove it
789
+ remove_workflow({
790
+ workflowId: '_0015'
791
+ })
792
+ ```
793
+
794
+ ### With `create_insight`
795
+
796
+ Find workflows for SQL queries:
797
+
798
+ ```javascript
799
+ // 1. Find relevant workflows
800
+ list_workflows_minimal({
801
+ search: "sales"
802
+ })
803
+
804
+ // Output:
805
+ // **Sales Leads**
806
+ // ID: `_0005`
807
+ //
808
+ // **Sales Orders**
809
+ // ID: `_0006`
810
+
811
+ // 2. Create insight joining these workflows
812
+ create_insight({
813
+ name: 'Sales Pipeline',
814
+ sql: `
815
+ SELECT
816
+ l.name as lead_name,
817
+ o.total as order_total
818
+ FROM _0005 l
819
+ LEFT JOIN _0006 o ON o.leadId = l._id
820
+ `
821
+ })
822
+ ```
823
+
824
+ ### With `create_app`
825
+
826
+ Find workflow IDs for app configuration:
827
+
828
+ ```javascript
829
+ // 1. Find workflow your app needs
830
+ list_workflows_minimal({
831
+ search: "products"
832
+ })
833
+
834
+ // Output: ID "_0008"
835
+
836
+ // 2. Create app with workflow config
837
+ create_app({
838
+ name: 'Product Manager',
839
+ url: 'http://localhost:3000',
840
+ config: {
841
+ workflowId: '_0008'
842
+ }
843
+ })
844
+ ```
845
+
846
+ ### With `update_workflow_field`
847
+
848
+ Find workflow to update:
849
+
850
+ ```javascript
851
+ // 1. Find workflow
852
+ list_workflows_minimal({
853
+ search: "tasks"
854
+ })
855
+
856
+ // Output: ID "_0001"
857
+
858
+ // 2. Get full schema to see fields
859
+ get_workflow_schema({
860
+ workflowId: "_0001"
861
+ })
862
+
863
+ // 3. Update field
864
+ update_workflow_field({
865
+ workflowId: '_0001',
866
+ fieldId: '_1000',
867
+ updates: { label: 'Task Name' }
868
+ })
869
+ ```
870
+
871
+ ## Additional Resources
872
+
873
+ ### Related Skills
874
+ - **install-workflow-skill** - Create new workflows
875
+ - **remove-workflow-skill** - Delete workflows
876
+ - **update-workflow-field-skill** - Modify workflow fields
877
+ - **create-insight-skill** - Create SQL insights over workflows
878
+ - **create-app-skill** - Create apps that use workflows
879
+
880
+ ### Related Tools
881
+ - `get_workflow_schema` - Get full workflow details (fields, phases, etc.)
882
+ - `install_workflow` - Create new workflows
883
+ - `remove_workflow` - Delete workflows
884
+ - `update_workflow_field` - Modify workflow fields
885
+
886
+ ### When to Use Which Tool
887
+
888
+ | Goal | Tool to Use | Reason |
889
+ |------|-------------|--------|
890
+ | Find workflow by name | `list_workflows_minimal` | Fast, minimal tokens |
891
+ | Get all workflows (small workspace) | Full workflow listing | Complete details in one call |
892
+ | Get all workflows (large workspace) | `list_workflows_minimal` | Avoid token limits |
893
+ | See workflow fields | `get_workflow_schema` | Need full schema |
894
+ | Check if workflow exists | `list_workflows_minimal` | Fast lookup |
895
+ | Generate workflow report | `list_workflows_minimal` | Efficient for many workflows |
896
+ | Debug workflow structure | `get_workflow_schema` | Need field/phase details |
897
+
898
+ ### Search Patterns
899
+
900
+ | Search Term | Matches |
901
+ |-------------|---------|
902
+ | `"task"` | "Tasks", "Task Manager", "Subtasks" |
903
+ | `"customer"` | "Customers", "Customer Service", "CRM Customers" |
904
+ | `"hr"` | "HR", "HR Onboarding", "Employee HR Records" |
905
+ | `""` (empty) | All workflows |
906
+ | `"a"` | Any workflow with "a" in name |
907
+
908
+ ### Pagination Patterns
909
+
910
+ ```javascript
911
+ // Pattern 1: Fixed page size
912
+ const PAGE_SIZE = 20;
913
+ list_workflows_minimal({ limit: PAGE_SIZE, offset: 0 })
914
+ list_workflows_minimal({ limit: PAGE_SIZE, offset: 20 })
915
+ list_workflows_minimal({ limit: PAGE_SIZE, offset: 40 })
916
+
917
+ // Pattern 2: Load all in chunks
918
+ let offset = 0;
919
+ const CHUNK_SIZE = 50;
920
+ while (hasMore) {
921
+ list_workflows_minimal({ limit: CHUNK_SIZE, offset: offset })
922
+ offset += CHUNK_SIZE;
923
+ }
924
+
925
+ // Pattern 3: Infinite scroll
926
+ let loaded = 0;
927
+ const onScrollBottom = () => {
928
+ list_workflows_minimal({ limit: 20, offset: loaded })
929
+ loaded += 20;
930
+ }
931
+ ```
932
+
933
+ ### Output Format
934
+
935
+ ```javascript
936
+ list_workflows_minimal({ search: "task" })
937
+ ```
938
+
939
+ **Returns:**
940
+ ```
941
+ 📋 Workflows Found
942
+
943
+ Total: 3 ← Total matching workflows
944
+ Showing: 3 ← Number displayed (after pagination)
945
+ Offset: 0 ← Current offset (if > 0)
946
+
947
+ ⭐ **Tasks** ← Star if starred
948
+ ID: `_0001` ← Workflow ID
949
+ Activities: 150 ← Number of activities
950
+
951
+ **Project Tasks**
952
+ ID: `_0007`
953
+ Activities: 45
954
+
955
+ **Task Templates**
956
+ ID: `_0012`
957
+ Activities: 0
958
+
959
+ 💡 Next Steps:
960
+ - Use `get_workflow_schema` with workflow ID to see fields
961
+ ```
962
+
963
+ ### Performance Comparison
964
+
965
+ | Workspace Size | Full Listing | Minimal Listing | Savings |
966
+ |----------------|--------------|-----------------|---------|
967
+ | 10 workflows | ~5,000 tokens | ~500 tokens | 90% |
968
+ | 50 workflows | ~25,000 tokens | ~2,000 tokens | 92% |
969
+ | 100 workflows | ~50,000 tokens | ~3,500 tokens | 93% |
970
+ | 200 workflows | ~100,000 tokens | ~7,000 tokens | 93% |
971
+
972
+ ### Workflow Discovery Strategies
973
+
974
+ 1. **Broad search first:**
975
+ ```javascript
976
+ list_workflows_minimal({ search: "customer" })
977
+ ```
978
+
979
+ 2. **Then narrow down:**
980
+ ```javascript
981
+ list_workflows_minimal({ search: "customer service" })
982
+ ```
983
+
984
+ 3. **Or browse by importance:**
985
+ ```javascript
986
+ list_workflows_minimal({ starredOnly: true })
987
+ ```
988
+
989
+ 4. **Or paginate through all:**
990
+ ```javascript
991
+ list_workflows_minimal({ limit: 25, offset: 0 })
992
+ ```