localnest_update_status
Check for available updates to the LocalNest MCP server, verifying if a newer version exists in the npm registry. Supports stable and beta channels with configurable response formats.
Instructions
Check npm for the latest localnest-mcp version on the selected channel (cached, default every 120 minutes).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force_check | No | ||
| channel | No | stable | |
| response_format | No | json |
Implementation Reference
- src/mcp/tools/core.js:73-90 (handler)Registration and handler mapping for localnest_update_status. It uses the `updates.getStatus` method.
registerJsonTool( ['localnest_update_status'], { title: 'Update Status', description: 'Check npm for the latest localnest-mcp version on the selected channel (cached, default every 120 minutes).', inputSchema: { force_check: z.boolean().default(false), channel: z.enum(['stable', 'beta']).default('stable') }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true } }, async ({ force_check, channel }) => normalizeUpdateStatus(await updates.getStatus({ force: force_check, channel })) ); - src/services/update/service.js:150-205 (handler)The implementation of the logic behind `localnest_update_status` which checks npm for new versions and manages the cache.
async getStatus({ force = false, channel = 'stable' } = {}) { const now = Date.now(); const cache = this.readCache(); const normalizedChannel = normalizeUpdateChannel(channel) || 'stable'; if (!this.shouldRefresh(cache, now, force) && cache && (cache.update_channel || 'stable') === normalizedChannel) { return this.withStatusMetadata({ ...cache, stale: false, source: 'cache' }, now); } try { const latestVersion = this.checkLatestFromNpm(normalizedChannel); const isOutdated = compareVersions(latestVersion, this.currentVersion) > 0; const refreshed = { package_name: this.packageName, current_version: this.currentVersion, latest_version: latestVersion, update_channel: normalizedChannel, is_outdated: isOutdated, checked_via: 'npm view', source: 'live', last_checked_at: new Date(now).toISOString(), last_check_ok: true, error: null, recommend_update_prompt: isOutdated, next_check_after_minutes: this.checkIntervalMinutes, cache_path: this.cachePath }; this.writeCache(refreshed); return this.withStatusMetadata(refreshed, now); } catch (error) { const fallbackLatest = cache?.latest_version || this.currentVersion; const fallbackChannel = cache?.update_channel || normalizedChannel; const isOutdated = compareVersions(fallbackLatest, this.currentVersion) > 0; const failed = { package_name: this.packageName, current_version: this.currentVersion, latest_version: fallbackLatest, update_channel: fallbackChannel, is_outdated: isOutdated, checked_via: 'npm view', source: cache ? 'cache-fallback' : 'error', last_checked_at: new Date(now).toISOString(), last_check_ok: false, error: String(error?.message || error), recommend_update_prompt: isOutdated, next_check_after_minutes: this.failureBackoffMinutes, cache_path: this.cachePath }; this.writeCache(failed); return this.withStatusMetadata(failed, now); } }