Expose build filters on the MCP build_list tool

build_list now takes optional version, pre_release_version and processing_state and passes them through BuildFilter, the same filter the CLI's apps builds flags use. A model can now ask for "build 42 of 1.1.0" directly instead of listing every build and filtering the result itself. Calls with only app_id behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Seto Elkahfi committed Oct 8, 2026 at 23:37 UTC bd72baca619574adb750ee727df06b51b3b15665
2 files changed +26 -3
crates/mcp/src/lib.rs
+8 -3
@@ -184,11 +184,11 @@ macro_rules! ascapi_mcp_tools {
184 name = $build_list_name,
185 title = "List builds",
186 annotations(title = "List builds", read_only_hint = true, idempotent_hint = true),
187 - description = "Purpose: list the builds uploaded for an app, so one can be attached to a version. When to use vs siblings: pair with app_store_version_set_build, which needs a build id from here. Behavior: returns each build's id, version string, upload date, and processing state. Prerequisites: ASC_API_KEY, ASC_ISSUER_ID, and a readable .p8 key at ASC_PRIVATE_KEY_PATH or ~/.appstoreconnect/private_keys/AuthKey_<key-id>.p8. Failure modes: missing or unreadable credentials return an invalid-request error naming what is absent; App Store Connect errors are returned verbatim with their status. Limitations: a build that is still processing cannot be attached yet, and this reports that state rather than waiting for it."
187 + description = "Purpose: list the builds uploaded for an app, so one can be attached to a version. When to use vs siblings: pair with app_store_version_set_build, which needs a build id from here. Behavior: returns each build's id, version string, upload date, and processing state, newest upload first, optionally narrowed by build number, marketing version, or processing state. Prerequisites: ASC_API_KEY, ASC_ISSUER_ID, and a readable .p8 key at ASC_PRIVATE_KEY_PATH or ~/.appstoreconnect/private_keys/AuthKey_<key-id>.p8. Failure modes: missing or unreadable credentials return an invalid-request error naming what is absent; App Store Connect errors are returned verbatim with their status. Limitations: a build that is still processing cannot be attached yet, and this reports that state rather than waiting for it."
188 )]
189 async fn build_list(
190 &self,
191 - parameters: ::rmcp::handler::server::wrapper::Parameters<$crate::AppIdRequest>,
191 + parameters: ::rmcp::handler::server::wrapper::Parameters<$crate::BuildListRequest>,
192 ) -> ::std::result::Result<::rmcp::model::CallToolResult, ::rmcp::model::ErrorData> {
193 #[allow(unused_imports)]
194 use ::smbcloud_ascapi_aso::prelude::*;
@@ -196,8 +196,13 @@ macro_rules! ascapi_mcp_tools {
196 use ::smbcloud_ascapi_signing::prelude::*;
197 let client = Self::client()?;
198 let request = parameters.0;
199 + let filter = ::smbcloud_ascapi_aso::build::BuildFilter {
200 + version: request.version,
201 + pre_release_version: request.pre_release_version,
202 + processing_state: request.processing_state,
203 + };
204 let value = client
200 - .list_builds(&request.app_id, &::smbcloud_ascapi_aso::build::BuildFilter::default())
205 + .list_builds(&request.app_id, &filter)
206 .await
207 .map_err(|error| ::rmcp::model::ErrorData::internal_error(error.to_string(), None))?;
208 Ok(::rmcp::model::CallToolResult::success(vec![
crates/mcp/src/requests.rs
+18
@@ -65,6 +65,24 @@ pub struct AppStoreVersionListRequest {
65 pub platform: Option<String>,
66 }
67
68 +#[derive(Debug, Clone, Deserialize, schemars::JsonSchema)]
69 +pub struct BuildListRequest {
70 + /// App Store Connect app id whose builds to list.
71 + pub app_id: String,
72 + /// Only return builds with this build number (CFBundleVersion), e.g.
73 + /// 42. Not the marketing version; use pre_release_version for that.
74 + #[serde(default)]
75 + pub version: Option<String>,
76 + /// Only return builds under this marketing version
77 + /// (CFBundleShortVersionString), e.g. 1.1.0.
78 + #[serde(default)]
79 + pub pre_release_version: Option<String>,
80 + /// Only return builds in this processing state: PROCESSING, FAILED,
81 + /// INVALID, or VALID.
82 + #[serde(default)]
83 + pub processing_state: Option<String>,
84 +}
85 +
86 #[derive(Debug, Clone, Deserialize, schemars::JsonSchema)]
87 pub struct IdRequest {
88 /// App Store Connect resource id.