diff --git a/bugbug/tools/code_review/prompts.py b/bugbug/tools/code_review/prompts.py index 7bffd5c442..8ee20da13a 100644 --- a/bugbug/tools/code_review/prompts.py +++ b/bugbug/tools/code_review/prompts.py @@ -28,7 +28,7 @@ **Step 3: Verify and Assess Confidence** - Use available tools when you need to verify concerns or gather additional context - Only include comments where you are at least 80% confident the issue is valid -- When uncertain about an issue, use tools like `find_function_definition` or `expand_context` to verify before commenting +- When uncertain about an issue, use available tools to verify before commenting - Do not suggest issues you cannot verify with available context **Step 4: Sort and Order Comments** diff --git a/services/mcp/src/bugbug_mcp/server.py b/services/mcp/src/bugbug_mcp/server.py index a10b6eb251..f3629aff2d 100644 --- a/services/mcp/src/bugbug_mcp/server.py +++ b/services/mcp/src/bugbug_mcp/server.py @@ -12,8 +12,6 @@ from fastmcp.resources import FileResource from pydantic import Field -from bugbug import utils -from bugbug.code_search.searchfox_api import FunctionSearchSearchfoxAPI from bugbug.tools.code_review.prompts import SYSTEM_PROMPT_TEMPLATE from bugbug.tools.core.platforms.bugzilla import SanitizedBug from bugbug.tools.core.platforms.phabricator import ( @@ -57,40 +55,6 @@ async def patch_review( return system_prompt + "\n\n" + initial_prompt -def get_file(commit_hash, path): - if commit_hash == "main": - commit_hash = "refs/heads/main" - - r = utils.get_session("githubusercontent").get( - f"https://raw.githubusercontent.com/mozilla-firefox/firefox/{commit_hash}/{path}", - headers={ - "User-Agent": utils.get_user_agent(), - }, - ) - r.raise_for_status() - return r.text - - -function_search = FunctionSearchSearchfoxAPI(get_file) - - -@mcp.tool() -def find_function_definition( - function_name: Annotated[str, "The name of the function to find its definition."], -) -> str: - """Find the definition of a function in the Firefox codebase using Searchfox.""" - functions = function_search.get_function_by_name( - "main", - "n/a", # The file path is not used - function_name, - ) - - if not functions: - return "Function definition not found." - - return functions[0].source - - @mcp.resource( uri="bugzilla://bug/{bug_id}", name="Bugzilla Bug Content",