refactor: rename debug_issue tool to debug for brevity
- Rename debug_issue.py to debug.py - Update tool name from 'debug_issue' to 'debug' throughout codebase - Update all references in server.py, tests, and README - Keep DebugIssueTool class name for backward compatibility - All tests pass with the renamed tool This makes the tool name shorter and more consistent with other tool names like 'chat' and 'analyze'. The functionality remains exactly the same. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
22
README.md
22
README.md
@@ -21,7 +21,7 @@ The ultimate development partner for Claude - a Model Context Protocol server th
|
||||
- [`think_deeper`](#2-think_deeper---extended-reasoning-partner) - Extended reasoning
|
||||
- [`review_code`](#3-review_code---professional-code-review) - Code review
|
||||
- [`review_changes`](#4-review_changes---pre-commit-validation) - Pre-commit validation
|
||||
- [`debug_issue`](#5-debug_issue---expert-debugging-assistant) - Debugging help
|
||||
- [`debug`](#5-debug---expert-debugging-assistant) - Debugging help
|
||||
- [`analyze`](#6-analyze---smart-file-analysis) - File analysis
|
||||
|
||||
- **Advanced Topics**
|
||||
@@ -44,7 +44,7 @@ Claude is brilliant, but sometimes you need:
|
||||
- **A second opinion** on complex architectural decisions - augment Claude's extended thinking with Gemini's perspective ([`think_deeper`](#2-think_deeper---extended-reasoning-partner))
|
||||
- **Professional code reviews** with actionable feedback across entire repositories ([`review_code`](#3-review_code---professional-code-review))
|
||||
- **Pre-commit validation** with deep analysis that finds edge cases, validates your implementation against original requirements, and catches subtle bugs Claude might miss ([`review_changes`](#4-review_changes---pre-commit-validation))
|
||||
- **Expert debugging** for tricky issues with full system context ([`debug_issue`](#5-debug_issue---expert-debugging-assistant))
|
||||
- **Expert debugging** for tricky issues with full system context ([`debug`](#5-debug---expert-debugging-assistant))
|
||||
- **Massive context window** (1M tokens) - Gemini 2.5 Pro can analyze entire codebases, read hundreds of files at once, and provide comprehensive insights ([`analyze`](#6-analyze---smart-file-analysis))
|
||||
- **Deep code analysis** across massive codebases that exceed Claude's context limits ([`analyze`](#6-analyze---smart-file-analysis))
|
||||
- **Dynamic collaboration** - Gemini can request additional context from Claude mid-analysis for more thorough insights
|
||||
@@ -325,7 +325,7 @@ Replace `/path/to/gemini-mcp-server` with the actual path where you cloned the r
|
||||
Just ask Claude naturally:
|
||||
- "Use gemini to think deeper about this architecture design" → `think_deeper`
|
||||
- "Get gemini to review this code for security issues" → `review_code`
|
||||
- "Get gemini to debug why this test is failing" → `debug_issue`
|
||||
- "Get gemini to debug why this test is failing" → `debug`
|
||||
- "Use gemini to analyze these files to understand the data flow" → `analyze`
|
||||
- "Brainstorm with gemini about scaling strategies" → `chat`
|
||||
- "Share my implementation plan with gemini for feedback" → `chat`
|
||||
@@ -338,7 +338,7 @@ Just ask Claude naturally:
|
||||
- **Need deeper thinking?** → `think_deeper` (extends Claude's analysis, finds edge cases)
|
||||
- **Code needs review?** → `review_code` (bugs, security, performance issues)
|
||||
- **Pre-commit validation?** → `review_changes` (validate git changes before committing)
|
||||
- **Something's broken?** → `debug_issue` (root cause analysis, error tracing)
|
||||
- **Something's broken?** → `debug` (root cause analysis, error tracing)
|
||||
- **Want to understand code?** → `analyze` (architecture, patterns, dependencies)
|
||||
- **Server info?** → `get_version` (version and configuration details)
|
||||
|
||||
@@ -451,7 +451,7 @@ If you prefer to use WSL (Windows Subsystem for Linux):
|
||||
2. [`think_deeper`](#2-think_deeper---extended-reasoning-partner) - Extended reasoning and problem-solving
|
||||
3. [`review_code`](#3-review_code---professional-code-review) - Professional code review with severity levels
|
||||
4. [`review_changes`](#4-review_changes---pre-commit-validation) - Validate git changes before committing
|
||||
5. [`debug_issue`](#5-debug_issue---expert-debugging-assistant) - Root cause analysis and debugging
|
||||
5. [`debug`](#5-debug---expert-debugging-assistant) - Root cause analysis and debugging
|
||||
6. [`analyze`](#6-analyze---smart-file-analysis) - General-purpose file and code analysis
|
||||
7. [`get_version`](#7-get_version---server-information) - Get server version and configuration
|
||||
|
||||
@@ -664,7 +664,7 @@ implementations or missing test coverage. Update the code based on gemini's find
|
||||
|
||||
**Triggers:** review pending changes, check my changes, validate changes, pre-commit review
|
||||
|
||||
### 5. `debug_issue` - Expert Debugging Assistant
|
||||
### 5. `debug` - Expert Debugging Assistant
|
||||
**Root cause analysis for complex problems**
|
||||
|
||||
**Thinking Mode:** Default is `medium` (8,192 tokens). Use `high` for tricky bugs (investment in finding root cause) or `low` for simple errors (save tokens).
|
||||
@@ -809,7 +809,7 @@ All tools that work with files support **both individual files and entire direct
|
||||
"Get gemini to review src/ with focus on performance, only show critical issues"
|
||||
```
|
||||
|
||||
**`debug_issue`** - Debug with file context
|
||||
**`debug`** - Debug with file context
|
||||
- `error_description`: Description of the issue (required)
|
||||
- `error_context`: Stack trace or logs
|
||||
- `files`: Files or directories related to the issue
|
||||
@@ -864,7 +864,7 @@ The server recognizes natural phrases. Just talk normally:
|
||||
### Automatic Tool Selection
|
||||
Claude will automatically pick the right tool based on your request:
|
||||
- "review" → `review_code`
|
||||
- "debug" → `debug_issue`
|
||||
- "debug" → `debug`
|
||||
- "analyze" → `analyze`
|
||||
- "think deeper" → `think_deeper`
|
||||
|
||||
@@ -882,7 +882,7 @@ Tools can reference files for additional context:
|
||||
To help choose the right tool for your needs:
|
||||
|
||||
**Decision Flow:**
|
||||
1. **Have a specific error/exception?** → Use `debug_issue`
|
||||
1. **Have a specific error/exception?** → Use `debug`
|
||||
2. **Want to find bugs/issues in code?** → Use `review_code`
|
||||
3. **Want to understand how code works?** → Use `analyze`
|
||||
4. **Have analysis that needs extension/validation?** → Use `think_deeper`
|
||||
@@ -891,7 +891,7 @@ To help choose the right tool for your needs:
|
||||
**Key Distinctions:**
|
||||
- `analyze` vs `review_code`: analyze explains, review_code prescribes fixes
|
||||
- `chat` vs `think_deeper`: chat is open-ended, think_deeper extends specific analysis
|
||||
- `debug_issue` vs `review_code`: debug diagnoses runtime errors, review finds static issues
|
||||
- `debug` vs `review_code`: debug diagnoses runtime errors, review finds static issues
|
||||
|
||||
## Thinking Modes - Managing Token Costs & Quality
|
||||
|
||||
@@ -1096,7 +1096,7 @@ The server uses carefully crafted system prompts to give each tool specialized e
|
||||
Each tool has a unique system prompt that defines its role and approach:
|
||||
- **`think_deeper`**: Acts as a senior development partner, challenging assumptions and finding edge cases
|
||||
- **`review_code`**: Expert code reviewer with security/performance focus, uses severity levels
|
||||
- **`debug_issue`**: Systematic debugger providing root cause analysis and prevention strategies
|
||||
- **`debug`**: Systematic debugger providing root cause analysis and prevention strategies
|
||||
- **`analyze`**: Code analyst focusing on architecture, patterns, and actionable insights
|
||||
|
||||
### Customization
|
||||
|
||||
@@ -61,7 +61,7 @@ server: Server = Server("gemini-server")
|
||||
TOOLS = {
|
||||
"think_deeper": ThinkDeeperTool(), # Extended reasoning for complex problems
|
||||
"review_code": ReviewCodeTool(), # Comprehensive code review and quality analysis
|
||||
"debug_issue": DebugIssueTool(), # Root cause analysis and debugging assistance
|
||||
"debug": DebugIssueTool(), # Root cause analysis and debugging assistance
|
||||
"analyze": AnalyzeTool(), # General-purpose file and code analysis
|
||||
"chat": ChatTool(), # Interactive development chat and brainstorming
|
||||
"review_changes": ReviewChanges(), # Pre-commit review of git changes
|
||||
|
||||
@@ -8,7 +8,7 @@ from unittest.mock import Mock, patch
|
||||
import pytest
|
||||
|
||||
from tools.analyze import AnalyzeTool
|
||||
from tools.debug_issue import DebugIssueTool
|
||||
from tools.debug import DebugIssueTool
|
||||
from tools.models import ClarificationRequest, ToolOutput
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class TestDynamicContextRequests:
|
||||
"question": "I need to see the database configuration to diagnose the connection error",
|
||||
"files_needed": ["config/database.yml", "src/db.py"],
|
||||
"suggested_next_action": {
|
||||
"tool": "debug_issue",
|
||||
"tool": "debug",
|
||||
"args": {
|
||||
"error_description": "Connection timeout to database",
|
||||
"files": [
|
||||
@@ -155,7 +155,7 @@ class TestDynamicContextRequests:
|
||||
|
||||
clarification = json.loads(response_data["content"])
|
||||
assert "suggested_next_action" in clarification
|
||||
assert clarification["suggested_next_action"]["tool"] == "debug_issue"
|
||||
assert clarification["suggested_next_action"]["tool"] == "debug"
|
||||
|
||||
def test_tool_output_model_serialization(self):
|
||||
"""Test ToolOutput model serialization"""
|
||||
|
||||
@@ -18,7 +18,7 @@ from mcp.types import TextContent
|
||||
from config import MCP_PROMPT_SIZE_LIMIT
|
||||
from tools.analyze import AnalyzeTool
|
||||
from tools.chat import ChatTool
|
||||
from tools.debug_issue import DebugIssueTool
|
||||
from tools.debug import DebugIssueTool
|
||||
from tools.review_changes import ReviewChanges
|
||||
from tools.review_code import ReviewCodeTool
|
||||
from tools.think_deeper import ThinkDeeperTool
|
||||
@@ -167,8 +167,8 @@ class TestLargePromptHandling:
|
||||
assert output["status"] == "requires_file_prompt"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_debug_issue_large_error_description(self, large_prompt):
|
||||
"""Test that debug_issue tool detects large error_description."""
|
||||
async def test_debug_large_error_description(self, large_prompt):
|
||||
"""Test that debug tool detects large error_description."""
|
||||
tool = DebugIssueTool()
|
||||
result = await tool.execute({"error_description": large_prompt})
|
||||
|
||||
@@ -177,8 +177,8 @@ class TestLargePromptHandling:
|
||||
assert output["status"] == "requires_file_prompt"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_debug_issue_large_error_context(self, large_prompt, normal_prompt):
|
||||
"""Test that debug_issue tool detects large error_context."""
|
||||
async def test_debug_large_error_context(self, large_prompt, normal_prompt):
|
||||
"""Test that debug tool detects large error_context."""
|
||||
tool = DebugIssueTool()
|
||||
result = await tool.execute({"error_description": normal_prompt, "error_context": large_prompt})
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import pytest
|
||||
|
||||
from tools.analyze import AnalyzeTool
|
||||
from tools.chat import ChatTool
|
||||
from tools.debug_issue import DebugIssueTool
|
||||
from tools.debug import DebugIssueTool
|
||||
from tools.review_changes import ReviewChanges
|
||||
from tools.review_code import ReviewCodeTool
|
||||
from tools.think_deeper import ThinkDeeperTool
|
||||
@@ -167,8 +167,8 @@ class TestPromptRegression:
|
||||
assert output["status"] == "success"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_debug_issue_normal_error(self, mock_model_response):
|
||||
"""Test debug_issue tool with normal error description."""
|
||||
async def test_debug_normal_error(self, mock_model_response):
|
||||
"""Test debug tool with normal error description."""
|
||||
tool = DebugIssueTool()
|
||||
|
||||
with patch.object(tool, "create_model") as mock_create_model:
|
||||
|
||||
@@ -21,7 +21,7 @@ class TestServerTools:
|
||||
# Check all core tools are present
|
||||
assert "think_deeper" in tool_names
|
||||
assert "review_code" in tool_names
|
||||
assert "debug_issue" in tool_names
|
||||
assert "debug" in tool_names
|
||||
assert "analyze" in tool_names
|
||||
assert "chat" in tool_names
|
||||
assert "review_changes" in tool_names
|
||||
|
||||
@@ -7,7 +7,7 @@ from unittest.mock import Mock, patch
|
||||
import pytest
|
||||
|
||||
from tools.analyze import AnalyzeTool
|
||||
from tools.debug_issue import DebugIssueTool
|
||||
from tools.debug import DebugIssueTool
|
||||
from tools.review_code import ReviewCodeTool
|
||||
from tools.think_deeper import ThinkDeeperTool
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class TestReviewCodeTool:
|
||||
|
||||
|
||||
class TestDebugIssueTool:
|
||||
"""Test the debug_issue tool"""
|
||||
"""Test the debug tool"""
|
||||
|
||||
@pytest.fixture
|
||||
def tool(self):
|
||||
@@ -111,7 +111,7 @@ class TestDebugIssueTool:
|
||||
|
||||
def test_tool_metadata(self, tool):
|
||||
"""Test tool metadata"""
|
||||
assert tool.get_name() == "debug_issue"
|
||||
assert tool.get_name() == "debug"
|
||||
assert "DEBUG & ROOT CAUSE ANALYSIS" in tool.get_description()
|
||||
assert tool.get_default_temperature() == 0.2
|
||||
|
||||
@@ -232,8 +232,8 @@ class TestAbsolutePathValidation:
|
||||
assert "../parent/file.py" in response["content"]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_debug_issue_tool_relative_path_rejected(self):
|
||||
"""Test that debug_issue tool rejects relative paths"""
|
||||
async def test_debug_tool_relative_path_rejected(self):
|
||||
"""Test that debug tool rejects relative paths"""
|
||||
tool = DebugIssueTool()
|
||||
result = await tool.execute(
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ Tool implementations for Gemini MCP Server
|
||||
|
||||
from .analyze import AnalyzeTool
|
||||
from .chat import ChatTool
|
||||
from .debug_issue import DebugIssueTool
|
||||
from .debug import DebugIssueTool
|
||||
from .review_changes import ReviewChanges
|
||||
from .review_code import ReviewCodeTool
|
||||
from .think_deeper import ThinkDeeperTool
|
||||
|
||||
@@ -16,7 +16,7 @@ from .models import ToolOutput
|
||||
|
||||
|
||||
class DebugIssueRequest(ToolRequest):
|
||||
"""Request model for debug_issue tool"""
|
||||
"""Request model for debug tool"""
|
||||
|
||||
error_description: str = Field(..., description="Error message, symptoms, or issue description")
|
||||
error_context: Optional[str] = Field(None, description="Stack trace, logs, or additional error context")
|
||||
@@ -32,7 +32,7 @@ class DebugIssueTool(BaseTool):
|
||||
"""Advanced debugging and root cause analysis tool"""
|
||||
|
||||
def get_name(self) -> str:
|
||||
return "debug_issue"
|
||||
return "debug"
|
||||
|
||||
def get_description(self) -> str:
|
||||
return (
|
||||
Reference in New Issue
Block a user