Skip to main content
Glama

rivian_get_charging_session

Get details on an active charging session, including power, battery level, time remaining, and cost.

Instructions

Check on an active charging session — power, battery level, time remaining, and cost.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • mcp-server.js:177-190 (registration)
    Registration of the 'rivian_get_charging_session' tool using server.tool() with an empty schema. Calls requireAuth, resolveVehicleId, rivian.getLiveChargingSession, and format.formatChargingSession.
    server.tool(
      'rivian_get_charging_session',
      'Check on an active charging session — power, battery level, time remaining, and cost.',
      {},
      async () => {
        try {
          requireAuth()
          const vehicleId = await resolveVehicleId()
          return text(format.formatChargingSession(await rivian.getLiveChargingSession(vehicleId)))
        } catch (err) {
          return text(err.message)
        }
      },
    )
  • Async handler that authenticates, resolves the vehicle ID, fetches the live charging session from the Rivian API, and formats the result for display.
      async () => {
        try {
          requireAuth()
          const vehicleId = await resolveVehicleId()
          return text(format.formatChargingSession(await rivian.getLiveChargingSession(vehicleId)))
        } catch (err) {
          return text(err.message)
        }
      },
    )
  • getLiveChargingSession function that executes a GraphQL query 'getLiveSessionData' against the charging endpoint, returning charging session data (power, SOC, range, energy, cost, etc.).
    export async function getLiveChargingSession(vehicleId) {
      const body = {
        operationName: 'getLiveSessionData',
        query: `query getLiveSessionData($vehicleId: ID!) {
      getLiveSessionData(vehicleId: $vehicleId) {
        __typename
        chargerId
        current { __typename value updatedAt }
        currentCurrency
        currentMiles { __typename value updatedAt }
        currentPrice
        isFreeSession
        isRivianCharger
        kilometersChargedPerHour { __typename value updatedAt }
        locationId
        power { __typename value updatedAt }
        rangeAddedThisSession { __typename value updatedAt }
        soc { __typename value updatedAt }
        startTime
        timeElapsed
        timeRemaining { __typename value updatedAt }
        totalChargedEnergy { __typename value updatedAt }
        vehicleChargerState { __typename value updatedAt }
      }
    }`,
        variables: { vehicleId },
      }
    
      return (await gql(GRAPHQL_CHARGING, body, chargingHeaders())).getLiveSessionData
    }
  • formatChargingSession function that formats the charging session data into a human-readable display with power, SOC bar, range, energy, current, time elapsed, time remaining, network, cost, and charger state.
    export function formatChargingSession(data) {
      if (!data) return c.dim('No active charging session.')
    
      const lines = [section('Charging Session'), '']
    
      const add = (label, entry, suffix = '') => {
        const value = entry?.value
        if (value !== undefined && value !== null) lines.push(kv(label, value, suffix))
      }
    
      const soc = data.soc?.value
      if (soc !== undefined && soc !== null) {
        lines.push(`  ${bar(soc)}  ${c.bold(soc + '%')}`)
      }
      add('Power', data.power, ' kW')
      add('Range added', data.rangeAddedThisSession, ' miles')
      add('Energy charged', data.totalChargedEnergy, ' kWh')
      add('Current', data.current, ' A')
      if (data.timeElapsed) lines.push(kv('Time elapsed', data.timeElapsed))
      add('Time remaining', data.timeRemaining, ' min')
    
      if (data.isRivianCharger) lines.push(kv('Network', c.green('Rivian Adventure Network')))
      if (data.isFreeSession) {
        lines.push(kv('Cost', c.green('Free')))
      } else if (data.currentPrice) {
        lines.push(kv('Cost so far', `${data.currentCurrency || '$'}${data.currentPrice}`))
      }
    
      add('Charger state', data.vehicleChargerState)
    
      return lines.filter((l) => l !== null).join('\n')
    }
  • Empty schema object ({}) for the tool - no input parameters are required.
    {},
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries burden. It states it checks an active session, implying it may fail if none active, but does not disclose error handling or authentication needs. Adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with purpose, concise and to the point. No extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and no output schema, the description covers the core functionality and return fields. Could mention potential errors or response format, but sufficient for a simple read operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has zero parameters and 100% coverage, so description need not add parameter info. Baseline score of 4 is appropriate for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'check' and resource 'active charging session', and lists specific data returned (power, battery level, time remaining, cost). It distinguishes from sibling tools like rivian_get_charging_history by focusing on the active session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by 'active charging session', but no explicit guidance on when to use alternatives or prerequisites. For a simple read tool, the implication suffices, but explicit context would be helpful.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/PatrickHeneise/rivian-mcp'

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