rivian_get_ota_status
Check your Rivian's current software version and detect if a new update is available.
Instructions
Check for software updates — what version you're running and whether a new one is available.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server.js:162-174 (handler)The registration of the 'rivian_get_ota_status' tool on the MCP server. The handler calls requireAuth(), resolves the vehicle ID, then calls rivian.getOTAUpdateDetails(vehicleId) and formats the result via format.formatOTAStatus().
server.tool( 'rivian_get_ota_status', "Check for software updates — what version you're running and whether a new one is available.", {}, async () => { try { requireAuth() const vehicleId = await resolveVehicleId() return text(format.formatOTAStatus(await rivian.getOTAUpdateDetails(vehicleId))) } catch (err) { return text(err.message) } }, - lib/rivian-api.js:183-199 (schema)The GraphQL query that fetches OTA update details for a vehicle: availableOTAUpdateDetails, currentOTAUpdateDetails, and vehicleState.otaStatus.
export async function getOTAUpdateDetails(vehicleId) { const body = { operationName: 'getOTAUpdateDetails', query: `query getOTAUpdateDetails($vehicleId: String!) { getVehicle(id: $vehicleId) { availableOTAUpdateDetails { url version locale } currentOTAUpdateDetails { url version locale } vehicleState { otaStatus { value timeStamp } } } }`, variables: { vehicleId }, } return (await gql(GRAPHQL_GATEWAY, body, authHeaders())).getVehicle } - lib/format.js:472-504 (helper)Formats the OTA status data into a human-readable string showing current version, update status, and whether a new update is available.
export function formatOTAStatus(ota) { const lines = [] lines.push(section('Software Update')) lines.push('') if (ota.currentOTAUpdateDetails) { lines.push(kv('Current', `v${ota.currentOTAUpdateDetails.version}`)) } else { lines.push(kv('Current', c.dim('unknown'))) } const otaStatus = ota.vehicleState?.otaStatus?.value if (otaStatus) { const statusColor = otaStatus.toLowerCase() === 'idle' ? c.green : c.yellow lines.push(kv('Status', statusColor(otaStatus))) } if (ota.availableOTAUpdateDetails) { lines.push(kv('Update available', c.yellow(`v${ota.availableOTAUpdateDetails.version}`))) if (ota.availableOTAUpdateDetails.url) { lines.push(kv('Release notes', ota.availableOTAUpdateDetails.url)) } } else if (otaStatus && otaStatus.toLowerCase() !== 'idle') { lines.push('') lines.push(` ${c.yellow('⏳')} Flagged for update — details pending.`) } else { lines.push('') lines.push(` ${c.green('✓')} Software is up to date.`) } return lines.filter((l) => l !== null).join('\n') } - mcp-server.js:162-175 (registration)Tool registration via server.tool() call with the name 'rivian_get_ota_status'. Also serves as the handler in this file since the implementation is inline.
server.tool( 'rivian_get_ota_status', "Check for software updates — what version you're running and whether a new one is available.", {}, async () => { try { requireAuth() const vehicleId = await resolveVehicleId() return text(format.formatOTAStatus(await rivian.getOTAUpdateDetails(vehicleId))) } catch (err) { return text(err.message) } }, )