release-check-versions
Check current app versions across App Store and Google Play to monitor release status and ensure consistent deployment across platforms.
Instructions
Check latest versions from App Store/Google Play.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Registered app slug | |
| packageName | No | Google Play package name | |
| bundleId | No | App Store bundle ID | |
| store | No | Target store (default: both) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"app": {
"description": "Registered app slug",
"type": "string"
},
"bundleId": {
"description": "App Store bundle ID",
"type": "string"
},
"packageName": {
"description": "Google Play package name",
"type": "string"
},
"store": {
"description": "Target store (default: both)",
"enum": [
"appStore",
"googlePlay",
"both"
],
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- Main handler function for the 'release-check-versions' tool. Resolves app identifiers, determines which stores to check, gathers skip messages if applicable, calls getLatestVersions helper, and returns formatted text response.export async function handleCheckLatestVersions(options: CheckVersionsOptions) { const { app, store } = options; let { packageName, bundleId } = options; const { store: selectedStore, includeAppStore, includeGooglePlay, } = getStoreTargets(store); console.error(`[MCP] π Checking latest versions (store: ${selectedStore})`); const resolved = appResolutionService.resolve({ slug: app, packageName, bundleId, }); if (!resolved.success) { return { content: [ { type: "text" as const, text: resolved.error.message, }, ], }; } const { slug, bundleId: resolvedBundleId, packageName: resolvedPackageName, hasAppStore, hasGooglePlay, } = resolved.data; bundleId = resolvedBundleId; packageName = resolvedPackageName; // Check latest versions (without prompt message since this is a dedicated check tool) console.error(`[MCP] App: ${slug}`); if (bundleId) console.error(`[MCP] App Store bundleId: ${bundleId}`); if (packageName) console.error(`[MCP] Google Play packageName: ${packageName}`); const skips: string[] = []; if (includeAppStore && !hasAppStore) { skips.push(`βοΈ Skipping App Store (not registered for App Store)`); } else if (includeAppStore && !bundleId) { skips.push(`βοΈ Skipping App Store (no bundleId provided)`); } if (includeGooglePlay && !hasGooglePlay) { skips.push(`βοΈ Skipping Google Play (not registered for Google Play)`); } else if (includeGooglePlay && !packageName) { skips.push(`βοΈ Skipping Google Play (no packageName provided)`); } const versionInfo = await getLatestVersions({ bundleId, includePrompt: false, store: selectedStore, packageName, hasAppStore, hasGooglePlay, }); console.error(`[MCP] β Version check completed`); const contentLines = [...skips, ...versionInfo.messages]; return { content: [ { type: "text" as const, text: contentLines.join("\n"), }, ], }; }
- Core helper function that performs the actual API calls to AppStoreService and GooglePlayService to retrieve the latest version information for the given app identifiers, handling skips and errors, and compiling messages and structured results.export async function getLatestVersions( input: LatestVersionsInput ): Promise<LatestVersionsResult> { const { store, bundleId, packageName, hasAppStore, hasGooglePlay, includePrompt = true, } = input; const { includeAppStore, includeGooglePlay } = getStoreTargets(store); const config = loadConfig(); const messages: string[] = []; messages.push(`\nπ Checking latest versions from stores...\n`); const result: LatestVersionsResult = { messages }; if (includeAppStore) { if (!hasAppStore) { const skipped = `βοΈ Skipping App Store (not registered for App Store)`; messages.push(skipped); result.appStore = { found: false, skipped }; } else if (!config.appStore) { const skipped = `βοΈ Skipping App Store (not configured in ~/.config/pabal-mcp/config.json)`; messages.push(skipped); result.appStore = { found: false, skipped }; } else if (!bundleId) { const skipped = `βοΈ Skipping App Store (no bundleId provided)`; messages.push(skipped); result.appStore = { found: false, skipped }; } else { const latest = await appStoreService.getLatestVersion(bundleId); if (!latest.found) { const errMsg = latest.error instanceof Error ? latest.error.message : (latest.error ?? ""); const msg = errMsg ? `π App Store: Check failed - ${errMsg}` : `π App Store: No version found (can create first version)`; messages.push(msg); result.appStore = { found: false, error: errMsg || undefined }; } else { const state = latest.state?.toUpperCase() || "UNKNOWN"; messages.push(`π App Store: ${latest.versionString} (${state})`); result.appStore = { found: true, versionString: latest.versionString, state, }; } } } if (includeGooglePlay) { if (!hasGooglePlay) { const skipped = `βοΈ Skipping Google Play (not registered for Google Play)`; messages.push(skipped); result.googlePlay = { found: false, skipped }; } else if (!config.playStore) { const skipped = `βοΈ Skipping Google Play (not configured in ~/.config/pabal-mcp/config.json)`; messages.push(skipped); result.googlePlay = { found: false, skipped }; } else if (!packageName) { const skipped = `βοΈ Skipping Google Play (no packageName provided)`; messages.push(skipped); result.googlePlay = { found: false, skipped }; } else { const latest = await googlePlayService.getLatestProductionRelease(packageName); if (!latest.found) { const errMsg = latest.error instanceof Error ? latest.error.message : (latest.error ?? ""); const msg = errMsg ? `π€ Google Play: Check failed - ${errMsg}` : `π€ Google Play: No version found (can create first version)`; messages.push(msg); result.googlePlay = { found: false, error: errMsg || undefined }; } else { const versionName = latest.versionName || latest.releaseName || "N/A"; const status = latest.status?.toUpperCase() || "UNKNOWN"; messages.push( `π€ Google Play: ${versionName} (versionCodes: ${latest.versionCodes.join( ", " )}, ${status})` ); result.googlePlay = { found: true, versionName, versionCodes: latest.versionCodes, status, releaseName: latest.releaseName, }; } } } if (includePrompt) { messages.push( `\nπ‘ To create a new version, please provide the 'version' parameter.` ); messages.push(` Example: Call release-create tool with version="1.2.0".`); } return result; }
- src/index.ts:284-297 (registration)Registers the 'release-check-versions' tool with the MCP server, including its name, description, input schema, handler function, and category.registerToolWithInfo( "release-check-versions", { description: "Check latest versions from App Store/Google Play.", inputSchema: z.object({ app: z.string().optional().describe("Registered app slug"), packageName: z.string().optional().describe("Google Play package name"), bundleId: z.string().optional().describe("App Store bundle ID"), store: storeSchema.describe("Target store (default: both)"), }), }, handleCheckLatestVersions, "Release Management" );
- src/index.ts:288-293 (schema)Zod input schema defining optional parameters: app slug, packageName, bundleId, and store (defaults to both). Used for input validation in the tool registration.inputSchema: z.object({ app: z.string().optional().describe("Registered app slug"), packageName: z.string().optional().describe("Google Play package name"), bundleId: z.string().optional().describe("App Store bundle ID"), store: storeSchema.describe("Target store (default: both)"), }),