Skip to main content

devboy_core/
tool_category.rs

1//! Tool categories for capability-based filtering.
2//!
3//! Providers declare which categories they support.
4//! Tools are tagged with a category. Only tools from
5//! supported categories are shown in `list_tools()`.
6
7use serde::{Deserialize, Serialize};
8
9/// Category of MCP tools — determines which tools are available
10/// based on provider capabilities.
11///
12/// Variant order is also the canonical display order used by
13/// auto-generated documentation (`devboy tools docs`).
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
15#[serde(rename_all = "snake_case")]
16pub enum ToolCategory {
17    /// Issue tracker tools: issues CRUD, comments, statuses.
18    /// Providers: GitLab, GitHub, ClickUp, Jira, YouGile, Linear
19    IssueTracker,
20
21    /// Git repository tools: MR/PR, pipeline, diffs, discussions.
22    /// Providers: GitLab, GitHub
23    GitRepository,
24
25    /// Epic tools: high-level tasks with goals and progress.
26    /// Providers: ClickUp
27    Epics,
28
29    /// Release tools: tags, releases, assets.
30    /// Providers: GitLab, GitHub
31    Releases,
32
33    /// Meeting notes tools: transcripts, summaries, search.
34    /// Providers: Fireflies
35    MeetingNotes,
36
37    /// Knowledge base tools: spaces, pages, search, page updates.
38    /// Providers: Confluence
39    KnowledgeBase,
40
41    /// Messenger tools: chats, messages, search, sending.
42    /// Providers: Slack
43    Messenger,
44
45    /// Jira Structure plugin tools: hierarchies, views, formulas.
46    /// Providers: Jira (requires Structure plugin)
47    JiraStructure,
48}
49
50impl ToolCategory {
51    /// Stable, human-readable display name used in documentation.
52    pub fn display_name(self) -> &'static str {
53        match self {
54            ToolCategory::IssueTracker => "Issue Tracker",
55            ToolCategory::GitRepository => "Git Repository",
56            ToolCategory::Epics => "Epics",
57            ToolCategory::Releases => "Releases",
58            ToolCategory::MeetingNotes => "Meeting Notes",
59            ToolCategory::KnowledgeBase => "Knowledge Base",
60            ToolCategory::Messenger => "Messenger",
61            ToolCategory::JiraStructure => "Jira Structure",
62        }
63    }
64
65    /// Snake-case key used in JSON output (matches `serde(rename_all)`).
66    pub fn key(self) -> &'static str {
67        match self {
68            ToolCategory::IssueTracker => "issue_tracker",
69            ToolCategory::GitRepository => "git_repository",
70            ToolCategory::Epics => "epics",
71            ToolCategory::Releases => "releases",
72            ToolCategory::MeetingNotes => "meeting_notes",
73            ToolCategory::KnowledgeBase => "knowledge_base",
74            ToolCategory::Messenger => "messenger",
75            ToolCategory::JiraStructure => "jira_structure",
76        }
77    }
78}