mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Limit search_projects to actual Projects
This means we are excluding Portfolios and Programs from it. Those will need their own tools.
This commit is contained in:
@@ -65,7 +65,7 @@ module McpTools
|
||||
)
|
||||
|
||||
def call(page: nil, **filters)
|
||||
filtered = apply_filters(Project.visible, filters)
|
||||
filtered = apply_filters(Project.project.visible, filters)
|
||||
projects = apply_pagination(filtered, page)
|
||||
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ RSpec.describe McpTools::SearchProjects, with_flag: { mcp_server: true } do
|
||||
|
||||
let!(:project_a) { create(:project, identifier: "abc", name: "The ABC Project", status_code: :on_track) }
|
||||
let!(:project_b) { create(:project, identifier: "def", name: "The DEF Project", status_code: :off_track) }
|
||||
let!(:portfolio) { create(:portfolio, identifier: "ghi", name: "The unrelated Portfolio", status_code: :on_track) }
|
||||
|
||||
let(:server_config) { create(:mcp_configuration, identifier: "mcp_server") }
|
||||
let(:tool_config) { create(:mcp_configuration, identifier: described_class.qualified_name) }
|
||||
|
||||
Reference in New Issue
Block a user