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