rivian_get_charging_schedule
Retrieve your Rivian's charging schedule to see scheduled charging times and days.
Instructions
See your charging schedule — what times and days your vehicle is set to charge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server.js:206-219 (registration)Tool registration for 'rivian_get_charging_schedule' on the MCP server with description and empty schema.
server.tool( 'rivian_get_charging_schedule', 'See your charging schedule — what times and days your vehicle is set to charge.', {}, async () => { try { requireAuth() const vehicleId = await resolveVehicleId() return text(format.formatChargingSchedule(await rivian.getChargingSchedule(vehicleId))) } catch (err) { return text(err.message) } }, ) - mcp-server.js:210-218 (handler)Handler function: calls requireAuth(), resolves vehicle ID, fetches charging schedule via rivian.getChargingSchedule(), and formats the output via format.formatChargingSchedule().
async () => { try { requireAuth() const vehicleId = await resolveVehicleId() return text(format.formatChargingSchedule(await rivian.getChargingSchedule(vehicleId))) } catch (err) { return text(err.message) } }, - mcp-server.js:209-209 (schema)Input schema is an empty object '{}', so this tool takes no parameters.
{}, - lib/rivian-api.js:260-279 (helper)API helper: getChargingSchedule() sends a GraphQL query 'GetChargingSchedule' to the Rivian API to fetch charging schedule data (startTime, duration, location, amperage, enabled, weekDays).
export async function getChargingSchedule(vehicleId) { const body = { operationName: 'GetChargingSchedule', query: `query GetChargingSchedule($vehicleId: String!) { getVehicle(id: $vehicleId) { chargingSchedules { startTime duration location { latitude longitude } amperage enabled weekDays } } }`, variables: { vehicleId }, } return (await gql(GRAPHQL_GATEWAY, body, authHeaders())).getVehicle } - lib/format.js:601-634 (helper)Format helper: formatChargingSchedule() formats the raw charging schedule data into human-readable text showing time ranges, amperage, days, and location.
export function formatChargingSchedule(data) { const schedules = data?.chargingSchedules if (!schedules?.length) return c.dim('No charging schedules configured.') const lines = [section('Charging Schedules'), ''] for (const s of schedules) { const startHour = Math.floor(s.startTime / 60) const startMin = s.startTime % 60 const endMinutes = s.startTime + s.duration const endHour = Math.floor(endMinutes / 60) % 24 const endMin = endMinutes % 60 const fmt = (h, m) => { const period = h >= 12 ? 'PM' : 'AM' const hour12 = h % 12 || 12 return `${hour12}:${String(m).padStart(2, '0')} ${period}` } const enabled = s.enabled ? c.green('●') : c.red('●') lines.push( ` ${enabled} ${c.bold(`${fmt(startHour, startMin)} – ${fmt(endHour, endMin)}`)} ${c.dim(`(${s.duration / 60}h)`)}`, ) lines.push(kv('Amperage', s.amperage, 'A')) if (s.weekDays?.length) lines.push(kv('Days', s.weekDays.join(', '))) if (s.location) lines.push(kv('Location', `${s.location.latitude}, ${s.location.longitude}`)) lines.push('') } return lines .filter((l) => l !== null) .join('\n') .trim() }