Skip to content

[Agentic Chat Integration] Support project_path in Codebase Search tool

Context

The Codebase Search tool should support a project_path parameter as well as a project_id. Essentially, the LLM should be able to provide either of these things.

See slack comments:

@terrichu: The other tools allow you to specify the project path (gitlab-org/gitlab) - does that work for this one?

@terrichu: The MCP tools that hit the API endpoints are benefiting from the built in translation done in the API in lib/api/helpers.rb.

Custom tools should do the same translation and support both ID or URL-encoded path of the project. WDYT about using the API helper concern in the custom tool for project lookup?

Reference

See code on how the API helper gets the project_id from a project_path: https://gitlab.com/gitlab-org/gitlab/-/blob/9b62526aa162356183c61f28f50da5fb7995c605/lib/api/helpers.rb#L152-152

Proposal

  • Add a project_path parameter to the tool
  • This should be accepted as an alternative to project_id
  • Determine the project_id from the project_path following the code from the API helpers
Edited by 🤖 GitLab Bot 🤖