Update the MCP Codebase Search tool name and description
What does this MR do and why?
This changes the Codebase Semantic Search MCP tool:
- updates tool name from
get_code_context
tosemantic_code_search
, which is more descriptive of what it does - updates tool description to give more information about what is powering the search + how and when it can be used
- renames the
search_term
parameter tosemantic_query
- updates some parameter descriptions to give a better idea of what to specify
These name and descriptions are based on Duo Chat recommendations, with tweaks based on my own understanding of the tool and context engineering best practices.
Caveat
These updates still does not guide the Agentic Chat into preferencing Codebase Semantic Search over the Duo Agent Platform's built-in GitlabSearch
tool. As mentioned in #573109 (comment 2807811095), Agentic Chat not picking the more appropriate tool is a larger problem outside of this.
Once GitlabSearch
has been migrated from DAP to MCP, putting it in the same group as the Codebase Semantic Search tool, we can look into further improvements (e.g.: adding some guidance about which tool is more appropriate when).
References
Related issues:
- [Agentic Chat Integration] Test Codebase Search... (#572264 - closed)
- [Agentic Chat Integration] Update name and desc... (#575227 - closed)
Screenshots or screen recordings
Tool on MCP Inspector
Tool usage with Agentic Chat
Agentic Chat still requires some prompting from the user like "using semantic search" in order to invoke the Codebase Semantic Search tool, but as noted above, Agentic Chat not picking the more appropriate tool is a larger problem outside of this.
Example 1 | Example 2 |
---|---|
Screen_Recording_2025-10-09_at_13.13.01 | Screen_Recording_2025-10-09_at_13.15.58 |
How to set up and validate locally
You just need to verify that the tool has been updated. To do so:
- Follow this development guide to setup the MCP server
- Follow the guide on debugging with MCP Inspector
- If you run into authentication issues, you can try debugging with mcp-remote first
- On the MCP Inspector browser page:
- connect to your local GDK's MCP server
- click "List Tools" - there should be a tool called
semantic_code_search
- click on
semantic_code_search
and check the descriptions
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.