mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
fix(mcp): align script auto_kind filter with scripts list API (#10098)
The MCP `get_items` script filter used `auto_kind IS NULL`, which excluded every script with a non-null `auto_kind` (pipeline, test, WAC, ...). These are valid runnable scripts and should surface as MCP tools. Switch to the deny-list `(auto_kind IS NULL OR auto_kind <> 'lib')`, matching the scripts list API (windmill-api-scripts). Only library scripts (no main function) are excluded; pipeline/test/WAC and any future auto_kind values are included. Fixes WIN-2190 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -149,7 +149,10 @@ pub async fn get_items<T: for<'a> sqlx::FromRow<'a, sqlx::postgres::PgRow> + Sen
|
||||
.and_where("o.archived = false");
|
||||
|
||||
if item_type == "script" {
|
||||
sqlb.and_where("o.auto_kind IS NULL");
|
||||
// only exclude library scripts (no main function); pipeline, test, WAC,
|
||||
// and any future `auto_kind` values remain callable. Mirrors the scripts
|
||||
// list API deny-list.
|
||||
sqlb.and_where("(o.auto_kind IS NULL OR o.auto_kind <> 'lib')");
|
||||
}
|
||||
|
||||
if let Some(prefix) = path_prefix {
|
||||
|
||||
Reference in New Issue
Block a user