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:
hugocasa
2026-07-14 21:00:27 +02:00
committed by GitHub
parent 2c702efec0
commit 4edffeb84b
+4 -1
View File
@@ -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 {