@vibescope/mcp-server 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/dist/api-client.d.ts +56 -1
  3. package/dist/api-client.js +17 -2
  4. package/dist/handlers/bodies-of-work.js +3 -2
  5. package/dist/handlers/deployment.js +3 -2
  6. package/dist/handlers/discovery.d.ts +3 -0
  7. package/dist/handlers/discovery.js +20 -652
  8. package/dist/handlers/fallback.js +18 -9
  9. package/dist/handlers/findings.d.ts +8 -1
  10. package/dist/handlers/findings.js +24 -3
  11. package/dist/handlers/session.js +23 -8
  12. package/dist/handlers/sprints.js +3 -2
  13. package/dist/handlers/tasks.js +22 -1
  14. package/dist/handlers/tool-docs.d.ts +4 -3
  15. package/dist/handlers/tool-docs.js +252 -5
  16. package/dist/handlers/validation.js +13 -1
  17. package/dist/index.js +25 -7
  18. package/dist/tools.js +30 -4
  19. package/package.json +1 -1
  20. package/src/api-client.ts +72 -2
  21. package/src/handlers/__test-setup__.ts +5 -0
  22. package/src/handlers/bodies-of-work.ts +27 -11
  23. package/src/handlers/deployment.ts +4 -2
  24. package/src/handlers/discovery.ts +23 -740
  25. package/src/handlers/fallback.test.ts +78 -0
  26. package/src/handlers/fallback.ts +20 -9
  27. package/src/handlers/findings.test.ts +129 -2
  28. package/src/handlers/findings.ts +32 -3
  29. package/src/handlers/session.test.ts +37 -2
  30. package/src/handlers/session.ts +29 -8
  31. package/src/handlers/sprints.ts +19 -6
  32. package/src/handlers/tasks.test.ts +61 -0
  33. package/src/handlers/tasks.ts +26 -1
  34. package/src/handlers/tool-docs.ts +1024 -0
  35. package/src/handlers/validation.test.ts +52 -0
  36. package/src/handlers/validation.ts +14 -1
  37. package/src/index.ts +25 -7
  38. package/src/tools.ts +30 -4
  39. package/src/knowledge.ts +0 -230
@@ -4,7 +4,24 @@
4
4
  * Handles tool discovery and documentation:
5
5
  * - discover_tools
6
6
  * - get_tool_info
7
+ *
8
+ * Note: Tool documentation is lazy-loaded from tool-docs.ts to save tokens.
9
+ * This saves ~8,000 tokens per schema load.
10
+ */
11
+ // Lazy-loaded tool documentation cache
12
+ let toolInfoCache = null;
13
+ /**
14
+ * Lazy-load tool documentation.
15
+ * Only loads the TOOL_INFO module when get_tool_info is called.
7
16
  */
17
+ async function getToolDocs() {
18
+ if (toolInfoCache) {
19
+ return toolInfoCache;
20
+ }
21
+ const { TOOL_INFO } = await import('./tool-docs.js');
22
+ toolInfoCache = TOOL_INFO;
23
+ return toolInfoCache;
24
+ }
8
25
  // Tool categories with brief descriptions
9
26
  const TOOL_CATEGORIES = {
10
27
  session: {
@@ -190,657 +207,6 @@ const TOOL_CATEGORIES = {
190
207
  ],
191
208
  },
192
209
  };
193
- // Detailed tool info (fetched on-demand)
194
- const TOOL_INFO = {
195
- start_work_session: `# start_work_session
196
- Initialize agent session and get assigned work.
197
-
198
- **Parameters:**
199
- - project_id (optional): Project UUID
200
- - git_url (optional): Git URL to find project
201
- - mode: 'lite' (default) or 'full' for complete context
202
-
203
- **Returns:** session_id, persona, project info, next_task
204
-
205
- **Example:** start_work_session(git_url: "https://github.com/org/repo")`,
206
- get_help: `# get_help
207
- Get workflow guidance on specific topics.
208
-
209
- **Parameters:**
210
- - topic (required): One of: getting_started, tasks, validation, deployment, git, blockers, milestones, fallback, session, tokens, topics
211
-
212
- **Example:** get_help(topic: "deployment")`,
213
- get_token_usage: `# get_token_usage
214
- Get token usage statistics for current session.
215
-
216
- **Returns:** total calls, total tokens, breakdown by tool, averages`,
217
- heartbeat: `# heartbeat
218
- Send heartbeat to maintain active status. Call every 30-60 seconds.
219
-
220
- **Parameters:**
221
- - session_id (optional): Uses current session if not provided`,
222
- end_work_session: `# end_work_session
223
- End session and release claimed tasks.
224
-
225
- **Parameters:**
226
- - session_id (optional): Uses current session if not provided
227
-
228
- **Returns:** Session summary with tasks completed, time spent`,
229
- get_project_context: `# get_project_context
230
- Get full project context including goals, instructions, tasks, blockers, decisions.
231
-
232
- **Parameters:**
233
- - project_id (optional): Project UUID
234
- - git_url (optional): Git URL to find project
235
-
236
- Without params, lists all projects.`,
237
- get_git_workflow: `# get_git_workflow
238
- Get git workflow config and branching instructions.
239
-
240
- **Parameters:**
241
- - project_id (required): Project UUID
242
- - task_id (optional): Include branch naming suggestion
243
-
244
- **Returns:** workflow type, branch names, auto-settings`,
245
- create_project: `# create_project
246
- Create a new project to track.
247
-
248
- **Parameters:**
249
- - name (required): Project display name
250
- - description: Brief description
251
- - goal: What "done" looks like
252
- - git_url: Repository URL
253
- - tech_stack: Array of technologies`,
254
- update_project: `# update_project
255
- Update project settings.
256
-
257
- **Parameters:**
258
- - project_id (required): Project UUID
259
- - name, description, goal, git_url, tech_stack, status
260
- - git_workflow: none, trunk-based, github-flow, git-flow
261
- - git_main_branch, git_develop_branch, git_auto_branch, git_auto_tag`,
262
- update_project_readme: `# update_project_readme
263
- Sync README content to the dashboard.
264
-
265
- **Parameters:**
266
- - project_id (required): Project UUID
267
- - readme_content (required): Markdown content`,
268
- get_tasks: `# get_tasks
269
- Get tasks for a project.
270
-
271
- **Parameters:**
272
- - project_id (required): Project UUID
273
- - status (optional): pending, in_progress, completed, cancelled
274
- - limit (optional): Max tasks (default 50)`,
275
- get_next_task: `# get_next_task
276
- Get highest priority pending task not claimed by another agent.
277
-
278
- **Parameters:**
279
- - project_id (required): Project UUID
280
-
281
- **Returns:** task or null, may suggest fallback activity`,
282
- add_task: `# add_task
283
- Create a new task.
284
-
285
- **Parameters:**
286
- - project_id (required): Project UUID
287
- - title (required): Task title
288
- - description: Detailed description
289
- - priority: 1-5 (1=highest, default 3)
290
- - estimated_minutes: Time estimate`,
291
- update_task: `# update_task
292
- Update task status, progress, or details.
293
-
294
- **Parameters:**
295
- - task_id (required): Task UUID
296
- - status: pending, in_progress, completed, cancelled
297
- - progress_percentage: 0-100
298
- - progress_note: Brief note (auto-logged)
299
- - title, description, priority, estimated_minutes, git_branch
300
-
301
- **Best practice:** Include progress_note with progress_percentage`,
302
- complete_task: `# complete_task
303
- Mark task as done.
304
-
305
- **Parameters:**
306
- - task_id (required): Task UUID
307
- - summary: What was done
308
-
309
- **Returns:** next_task, validation_count, blockers_count, deployment_priority`,
310
- delete_task: `# delete_task
311
- Delete a task.
312
-
313
- **Parameters:**
314
- - task_id (required): Task UUID`,
315
- batch_update_tasks: `# batch_update_tasks
316
- Update multiple tasks at once.
317
-
318
- **Parameters:**
319
- - updates (required): Array of {task_id, status?, progress_percentage?, progress_note?, priority?}`,
320
- batch_complete_tasks: `# batch_complete_tasks
321
- Complete multiple tasks at once.
322
-
323
- **Parameters:**
324
- - completions (required): Array of {task_id, summary?}`,
325
- add_task_reference: `# add_task_reference
326
- Add a reference URL to a task.
327
-
328
- **Parameters:**
329
- - task_id (required): Task UUID
330
- - url (required): Reference URL
331
- - label (optional): Display label`,
332
- remove_task_reference: `# remove_task_reference
333
- Remove a reference URL from a task.
334
-
335
- **Parameters:**
336
- - task_id (required): Task UUID
337
- - url (required): URL to remove`,
338
- add_milestone: `# add_milestone
339
- Add a milestone/step to a task.
340
-
341
- **Parameters:**
342
- - task_id (required): Task UUID
343
- - title (required): Milestone title
344
- - description (optional): Details
345
- - order_index (optional): Position (0-based)`,
346
- update_milestone: `# update_milestone
347
- Update a milestone.
348
-
349
- **Parameters:**
350
- - milestone_id (required): Milestone UUID
351
- - title, description, status (pending/in_progress/completed), order_index`,
352
- complete_milestone: `# complete_milestone
353
- Mark milestone as completed.
354
-
355
- **Parameters:**
356
- - milestone_id (required): Milestone UUID`,
357
- delete_milestone: `# delete_milestone
358
- Delete a milestone.
359
-
360
- **Parameters:**
361
- - milestone_id (required): Milestone UUID`,
362
- get_milestones: `# get_milestones
363
- Get all milestones for a task.
364
-
365
- **Parameters:**
366
- - task_id (required): Task UUID`,
367
- log_progress: `# log_progress
368
- Record a progress update.
369
-
370
- **Parameters:**
371
- - project_id (required): Project UUID
372
- - summary (required): Brief summary
373
- - task_id (optional): Link to task
374
- - details (optional): Extended notes`,
375
- get_activity_feed: `# get_activity_feed
376
- Get combined activity feed.
377
-
378
- **Parameters:**
379
- - project_id (required): Project UUID
380
- - types (optional): Array of task, progress, blocker, decision
381
- - created_by (optional): agent or user
382
- - since (optional): ISO date string
383
- - limit (optional): Max items (default 50)`,
384
- add_blocker: `# add_blocker
385
- Record a blocker preventing progress.
386
-
387
- **Parameters:**
388
- - project_id (required): Project UUID
389
- - description (required): What is blocking`,
390
- resolve_blocker: `# resolve_blocker
391
- Mark a blocker as resolved.
392
-
393
- **Parameters:**
394
- - blocker_id (required): Blocker UUID
395
- - resolution_note (optional): How it was resolved`,
396
- get_blockers: `# get_blockers
397
- Get blockers for a project.
398
-
399
- **Parameters:**
400
- - project_id (required): Project UUID
401
- - status (optional): open or resolved (default: open)`,
402
- delete_blocker: `# delete_blocker
403
- Delete a blocker.
404
-
405
- **Parameters:**
406
- - blocker_id (required): Blocker UUID`,
407
- log_decision: `# log_decision
408
- Record an architectural decision.
409
-
410
- **Parameters:**
411
- - project_id (required): Project UUID
412
- - title (required): Decision title
413
- - description (required): What was decided
414
- - rationale (optional): Why
415
- - alternatives_considered (optional): Array of alternatives`,
416
- get_decisions: `# get_decisions
417
- Get recorded decisions.
418
-
419
- **Parameters:**
420
- - project_id (required): Project UUID`,
421
- delete_decision: `# delete_decision
422
- Delete a decision.
423
-
424
- **Parameters:**
425
- - decision_id (required): Decision UUID`,
426
- add_idea: `# add_idea
427
- Record an improvement idea.
428
-
429
- **Parameters:**
430
- - project_id (required): Project UUID
431
- - title (required): Idea title
432
- - description (optional): Details
433
- - status (optional): raw, exploring, planned, in_development, shipped`,
434
- update_idea: `# update_idea
435
- Update an idea.
436
-
437
- **Parameters:**
438
- - idea_id (required): Idea UUID
439
- - title, description, status, doc_url`,
440
- get_ideas: `# get_ideas
441
- Get recorded ideas.
442
-
443
- **Parameters:**
444
- - project_id (required): Project UUID
445
- - status (optional): Filter by status`,
446
- delete_idea: `# delete_idea
447
- Delete an idea.
448
-
449
- **Parameters:**
450
- - idea_id (required): Idea UUID`,
451
- convert_idea_to_task: `# convert_idea_to_task
452
- Convert an idea to a task. Creates a new task from the idea's title and description.
453
-
454
- **Parameters:**
455
- - idea_id (required): Idea UUID to convert
456
- - priority (optional): Task priority 1-5 (default: 3)
457
- - estimated_minutes (optional): Estimated time
458
- - update_status (optional): Update idea to 'in_development' (default: true)
459
-
460
- **Returns:**
461
- - task_id: Created task UUID
462
- - Links idea and task together`,
463
- add_finding: `# add_finding
464
- Record an audit/review finding.
465
-
466
- **Parameters:**
467
- - project_id (required): Project UUID
468
- - title (required): Finding title
469
- - category: performance, security, code_quality, accessibility, documentation, architecture, testing, other
470
- - description: Details with impact and suggested fix
471
- - severity: info, low, medium, high, critical
472
- - file_path, line_number, related_task_id (optional)`,
473
- get_findings: `# get_findings
474
- Get audit findings.
475
-
476
- **Parameters:**
477
- - project_id (required): Project UUID
478
- - category, severity, status (optional filters)
479
- - limit (optional): Max items`,
480
- update_finding: `# update_finding
481
- Update a finding.
482
-
483
- **Parameters:**
484
- - finding_id (required): Finding UUID
485
- - status: open, addressed, dismissed, wontfix
486
- - resolution_note, title, description, severity`,
487
- delete_finding: `# delete_finding
488
- Delete a finding.
489
-
490
- **Parameters:**
491
- - finding_id (required): Finding UUID`,
492
- get_tasks_awaiting_validation: `# get_tasks_awaiting_validation
493
- Get completed tasks needing validation.
494
-
495
- **Parameters:**
496
- - project_id (required): Project UUID
497
-
498
- **Returns:** Tasks with reviewing status (who's reviewing, when started)`,
499
- claim_validation: `# claim_validation
500
- Claim a completed task for review. Shows "being reviewed" on dashboard.
501
-
502
- **Parameters:**
503
- - task_id (required): Task UUID to claim
504
-
505
- **Note:** Claim before reviewing to prevent duplicate work.`,
506
- validate_task: `# validate_task
507
- Validate a completed task.
508
-
509
- **Parameters:**
510
- - task_id (required): Task UUID
511
- - approved (required): true/false
512
- - validation_notes: What was checked, issues found`,
513
- request_deployment: `# request_deployment
514
- Request a deployment.
515
-
516
- **Parameters:**
517
- - project_id (required): Project UUID
518
- - environment: development, staging, production
519
- - version_bump: patch, minor, major
520
- - notes, git_ref (optional)`,
521
- claim_deployment_validation: `# claim_deployment_validation
522
- Claim pending deployment for validation.
523
-
524
- **Parameters:**
525
- - project_id (required): Project UUID
526
-
527
- Next: Run build+tests, then call report_validation`,
528
- report_validation: `# report_validation
529
- Report build/test results.
530
-
531
- **Parameters:**
532
- - project_id (required): Project UUID
533
- - build_passed (required): boolean
534
- - tests_passed (required): boolean
535
- - error_message (if failed)`,
536
- check_deployment_status: `# check_deployment_status
537
- Get active deployment status.
538
-
539
- **Parameters:**
540
- - project_id (required): Project UUID`,
541
- start_deployment: `# start_deployment
542
- Start deployment (requires 'ready' status).
543
-
544
- **Parameters:**
545
- - project_id (required): Project UUID`,
546
- complete_deployment: `# complete_deployment
547
- Mark deployment complete.
548
-
549
- **Parameters:**
550
- - project_id (required): Project UUID
551
- - success (required): boolean
552
- - summary: What was deployed or why failed`,
553
- cancel_deployment: `# cancel_deployment
554
- Cancel active deployment.
555
-
556
- **Parameters:**
557
- - project_id (required): Project UUID
558
- - reason (optional): Why cancelled`,
559
- schedule_deployment: `# schedule_deployment
560
- Schedule a deployment for a specific time.
561
-
562
- **Parameters:**
563
- - project_id (required): Project UUID
564
- - scheduled_at (required): ISO 8601 datetime
565
- - schedule_type (optional): once, daily, weekly, monthly (default: once)
566
- - auto_trigger (optional): Whether agents auto-trigger (default: true)
567
- - environment (optional): development, staging, production (default: production)
568
- - version_bump (optional): patch, minor, major (default: patch)
569
- - notes (optional): Notes about the deployment
570
- - git_ref (optional): Git branch or commit
571
-
572
- **Example:** schedule_deployment(project_id, scheduled_at: "2025-01-15T10:00:00Z", schedule_type: "weekly")`,
573
- get_scheduled_deployments: `# get_scheduled_deployments
574
- List scheduled deployments for a project.
575
-
576
- **Parameters:**
577
- - project_id (required): Project UUID
578
- - include_disabled (optional): Include disabled schedules (default: false)`,
579
- update_scheduled_deployment: `# update_scheduled_deployment
580
- Update a scheduled deployment's configuration.
581
-
582
- **Parameters:**
583
- - schedule_id (required): Schedule UUID
584
- - scheduled_at (optional): New scheduled time
585
- - schedule_type (optional): once, daily, weekly, monthly
586
- - auto_trigger (optional): Whether to auto-trigger
587
- - enabled (optional): Enable or disable
588
- - environment, version_bump, notes, git_ref (optional)`,
589
- delete_scheduled_deployment: `# delete_scheduled_deployment
590
- Delete a scheduled deployment.
591
-
592
- **Parameters:**
593
- - schedule_id (required): Schedule UUID`,
594
- trigger_scheduled_deployment: `# trigger_scheduled_deployment
595
- Manually trigger a scheduled deployment.
596
-
597
- Creates a new deployment using the schedule's configuration.
598
- Updates schedule: last_triggered_at, trigger_count, next scheduled_at (for recurring).
599
-
600
- **Parameters:**
601
- - schedule_id (required): Schedule UUID`,
602
- check_due_deployments: `# check_due_deployments
603
- Check for scheduled deployments that are due.
604
-
605
- Returns schedules where: enabled AND auto_trigger AND scheduled_at <= NOW()
606
-
607
- Use this to find deployments to trigger when working on a project.
608
-
609
- **Parameters:**
610
- - project_id (required): Project UUID`,
611
- start_fallback_activity: `# start_fallback_activity
612
- Start background activity when no tasks.
613
-
614
- **Parameters:**
615
- - project_id (required): Project UUID
616
- - activity (required): feature_ideation, code_review, performance_audit, ux_review, cost_analysis, security_review, test_coverage, documentation_review, dependency_audit, validate_completed_tasks`,
617
- stop_fallback_activity: `# stop_fallback_activity
618
- Stop current fallback activity.
619
-
620
- **Parameters:**
621
- - project_id (required): Project UUID
622
- - summary (optional): What was accomplished`,
623
- get_activity_history: `# get_activity_history
624
- Get background activity history.
625
-
626
- **Parameters:**
627
- - project_id (required): Project UUID
628
- - activity_type (optional): Filter by type
629
- - limit (optional): Max items`,
630
- get_activity_schedules: `# get_activity_schedules
631
- Get activity schedules.
632
-
633
- **Parameters:**
634
- - project_id (required): Project UUID`,
635
- get_pending_requests: `# get_pending_requests
636
- Get unacknowledged user requests.
637
-
638
- **Parameters:**
639
- - project_id (required): Project UUID`,
640
- acknowledge_request: `# acknowledge_request
641
- Mark a request as handled.
642
-
643
- **Parameters:**
644
- - request_id (required): Request UUID`,
645
- answer_question: `# answer_question
646
- Answer a user question from dashboard.
647
-
648
- **Parameters:**
649
- - request_id (required): Request UUID
650
- - answer (required): Your answer`,
651
- discover_tools: `# discover_tools
652
- List available tools by category.
653
-
654
- **Parameters:**
655
- - category (optional): Filter to specific category
656
-
657
- Without category, returns all categories with tool counts.
658
- With category, returns tools in that category with brief descriptions.`,
659
- get_tool_info: `# get_tool_info
660
- Get detailed info for a specific tool.
661
-
662
- **Parameters:**
663
- - tool_name (required): Name of the tool
664
-
665
- Returns: full documentation, parameters, examples, best practices.`,
666
- // Organization tools
667
- list_organizations: `# list_organizations
668
- List organizations the current user belongs to.
669
-
670
- **Parameters:** None
671
-
672
- **Returns:** Array of organizations with role and joined_at`,
673
- create_organization: `# create_organization
674
- Create a new organization. You become the owner.
675
-
676
- **Parameters:**
677
- - name (required): Organization display name
678
- - description (optional): Brief description
679
- - slug (optional): URL-friendly identifier (auto-generated if not provided)
680
-
681
- **Example:** create_organization(name: "Acme Corp", description: "Our development team")`,
682
- update_organization: `# update_organization
683
- Update organization details. Requires admin role.
684
-
685
- **Parameters:**
686
- - organization_id (required): Organization UUID
687
- - name, description, logo_url (optional updates)`,
688
- delete_organization: `# delete_organization
689
- Delete an organization. Requires owner role. Removes all shares.
690
-
691
- **Parameters:**
692
- - organization_id (required): Organization UUID
693
-
694
- **Warning:** This will remove all project shares with this organization.`,
695
- list_org_members: `# list_org_members
696
- List members of an organization.
697
-
698
- **Parameters:**
699
- - organization_id (required): Organization UUID
700
-
701
- **Returns:** Array of members with role and joined_at`,
702
- invite_member: `# invite_member
703
- Invite a user to an organization by email. Requires admin role.
704
-
705
- **Parameters:**
706
- - organization_id (required): Organization UUID
707
- - email (required): Email address to invite
708
- - role (optional): admin, member, or viewer (default: member)
709
-
710
- **Returns:** Invite details with token`,
711
- update_member_role: `# update_member_role
712
- Change a member's role. Requires admin role.
713
-
714
- **Parameters:**
715
- - organization_id (required): Organization UUID
716
- - user_id (required): User UUID to update
717
- - role (required): admin, member, or viewer
718
-
719
- **Note:** Cannot change your own role or the owner's role.`,
720
- remove_member: `# remove_member
721
- Remove a member from an organization. Requires admin role.
722
-
723
- **Parameters:**
724
- - organization_id (required): Organization UUID
725
- - user_id (required): User UUID to remove
726
-
727
- **Note:** Cannot remove the owner. Their org-scoped API keys are invalidated.`,
728
- leave_organization: `# leave_organization
729
- Leave an organization.
730
-
731
- **Parameters:**
732
- - organization_id (required): Organization UUID
733
-
734
- **Note:** Owner cannot leave. Must transfer ownership or delete organization.`,
735
- share_project_with_org: `# share_project_with_org
736
- Share a project with an organization. You must own the project.
737
-
738
- **Parameters:**
739
- - project_id (required): Project UUID
740
- - organization_id (required): Organization UUID to share with
741
- - permission (optional): read, write, or admin (default: read)
742
-
743
- **Permission levels:**
744
- - read: View project and tasks
745
- - write: Add/update tasks, log progress
746
- - admin: All write permissions plus deployments`,
747
- update_project_share: `# update_project_share
748
- Update the permission level for a project share.
749
-
750
- **Parameters:**
751
- - project_id (required): Project UUID
752
- - organization_id (required): Organization UUID
753
- - permission (required): read, write, or admin`,
754
- unshare_project: `# unshare_project
755
- Remove a project share from an organization.
756
-
757
- **Parameters:**
758
- - project_id (required): Project UUID
759
- - organization_id (required): Organization UUID
760
-
761
- **Note:** Org members will lose access immediately.`,
762
- list_project_shares: `# list_project_shares
763
- List all organizations a project is shared with.
764
-
765
- **Parameters:**
766
- - project_id (required): Project UUID
767
-
768
- **Returns:** Array of shares with organization info and permission level`,
769
- // Cost monitoring tools
770
- get_cost_summary: `# get_cost_summary
771
- Get cost summary (daily/weekly/monthly) for a project.
772
-
773
- **Parameters:**
774
- - project_id (required): Project UUID
775
- - period: 'daily' | 'weekly' | 'monthly' (default: daily)
776
- - limit: Max records to return (default: 30)
777
-
778
- **Returns:** Cost summary with totals and breakdown by model`,
779
- get_cost_alerts: `# get_cost_alerts
780
- Get cost alerts for the current user.
781
-
782
- **Parameters:**
783
- - project_id (optional): Filter by project
784
-
785
- **Returns:** Array of configured cost alerts`,
786
- add_cost_alert: `# add_cost_alert
787
- Add a cost threshold alert.
788
-
789
- **Parameters:**
790
- - project_id (optional): Specific project or null for all
791
- - threshold_amount (required): Amount in USD
792
- - threshold_period (required): 'daily' | 'weekly' | 'monthly'
793
- - alert_type: 'warning' | 'critical' (default: warning)
794
-
795
- **Example:** add_cost_alert(threshold_amount: 50, threshold_period: "daily", alert_type: "warning")`,
796
- update_cost_alert: `# update_cost_alert
797
- Update an existing cost alert.
798
-
799
- **Parameters:**
800
- - alert_id (required): Alert UUID
801
- - threshold_amount: New amount in USD
802
- - threshold_period: New period
803
- - alert_type: New alert type
804
- - enabled: Enable/disable the alert`,
805
- delete_cost_alert: `# delete_cost_alert
806
- Delete a cost alert.
807
-
808
- **Parameters:**
809
- - alert_id (required): Alert UUID to delete`,
810
- get_task_costs: `# get_task_costs
811
- Get cost breakdown by task for a project.
812
-
813
- **Parameters:**
814
- - project_id (required): Project UUID
815
- - limit: Max tasks to return (default: 20)
816
-
817
- **Returns:** Tasks sorted by estimated cost with model breakdown`,
818
- // Knowledge base tools
819
- query_knowledge_base: `# query_knowledge_base
820
- Query aggregated project knowledge in a single call. Reduces token usage by combining multiple data sources.
821
-
822
- **Parameters:**
823
- - project_id (required): Project UUID
824
- - scope: 'summary' (default) or 'detailed' (includes rationales, descriptions)
825
- - categories: Array of categories to include (default: all)
826
- - findings: Audit findings (security, performance, code quality)
827
- - qa: Questions and answers
828
- - decisions: Architectural decisions
829
- - completed_tasks: Tasks with completion summaries
830
- - blockers: Resolved blockers with resolution notes
831
- - progress: Recent progress logs
832
- - limit: Max items per category (default: 5, max: 20)
833
- - search_query: Optional text search across all knowledge
834
-
835
- **Returns:**
836
- - project: name, goal, tech_stack
837
- - stats: counts for each category, findings by severity
838
- - Category data based on selection
839
-
840
- **Token savings:** Replaces up to 6 separate tool calls (get_findings, get_decisions, get_tasks, get_blockers, etc.) with one call.
841
-
842
- **Example:** query_knowledge_base(project_id, categories: ["findings", "decisions"], limit: 10)`,
843
- };
844
210
  export const discoverTools = async (args) => {
845
211
  const { category } = args;
846
212
  if (category) {
@@ -881,7 +247,9 @@ export const getToolInfo = async (args) => {
881
247
  if (!tool_name) {
882
248
  return { result: { error: 'tool_name is required' } };
883
249
  }
884
- const info = TOOL_INFO[tool_name];
250
+ // Lazy-load tool documentation
251
+ const toolDocs = await getToolDocs();
252
+ const info = toolDocs[tool_name];
885
253
  if (!info) {
886
254
  return {
887
255
  result: {