Skip to main content
Glama
check-versions.ts2.6 kB
import { getStoreTargets } from "@/packages/configs/aso-config/store"; import { type StoreType } from "@/packages/configs/aso-config/types"; import { AppResolutionService } from "@/core/services/app-resolution-service"; import { getLatestVersions } from "@/core/workflows/version-info"; const appResolutionService = new AppResolutionService(); interface CheckVersionsOptions { app?: string; // Registered app slug packageName?: string; // For Google Play bundleId?: string; // For App Store store?: StoreType; } 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"), }, ], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/quartz-labs-dev/pabal-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server