Skip to main content
Glama

rivian_get_drivers_and_keys

Retrieve vehicle access details including drivers, phone keys, and key fobs to monitor who can operate your Rivian.

Instructions

See who has access to your vehicle — drivers, phone keys, and key fobs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vehicle_idYesVehicle ID from your account info

Implementation Reference

  • mcp-server.js:521-535 (registration)
    Tool registration with MCP server, including the schema definition (vehicle_id parameter) and handler that calls rivian.getDriversAndKeys() and formats the output.
    server.tool(
      'rivian_get_drivers_and_keys',
      'See who has access to your vehicle — drivers, phone keys, and key fobs.',
      {
        vehicle_id: z.string().describe('Vehicle ID from your account info'),
      },
      async ({ vehicle_id }) => {
        try {
          requireAuth();
          return text(formatDriversAndKeys(await rivian.getDriversAndKeys(vehicle_id)));
        } catch (err) {
          return text(err.message);
        }
      },
    );
  • The async handler function that executes when the tool is called - requires authentication, calls the API, and returns formatted text.
    async ({ vehicle_id }) => {
      try {
        requireAuth();
        return text(formatDriversAndKeys(await rivian.getDriversAndKeys(vehicle_id)));
      } catch (err) {
        return text(err.message);
      }
    },
  • Zod schema defining the vehicle_id input parameter for the tool.
    vehicle_id: z.string().describe('Vehicle ID from your account info'),
  • Core implementation that executes the GraphQL query to Rivian's API to fetch drivers, phone keys, and key fobs for a given vehicle.
    export async function getDriversAndKeys(vehicleId) {
      const body = {
        operationName: 'DriversAndKeys',
        query: `query DriversAndKeys($vehicleId: String) {
      getVehicle(id: $vehicleId) {
        __typename
        id
        vin
        invitedUsers {
          __typename
          ... on ProvisionedUser {
            firstName lastName email roles userId
            devices { type mappedIdentityId id hrid deviceName isPaired isEnabled }
          }
          ... on UnprovisionedUser {
            email inviteId status
          }
        }
      }
    }`,
        variables: { vehicleId },
      };
    
      return (await gql(GRAPHQL_GATEWAY, body, authHeaders())).getVehicle;
    }
  • Helper function that formats the API response into readable text, displaying user roles, devices, and their pairing/enabled status.
    function formatDriversAndKeys(data) {
      const lines = [];
    
      if (data.vin) lines.push(`Vehicle: ${data.vin}`);
    
      if (!data.invitedUsers?.length) {
        lines.push('No drivers or keys found.');
        return lines.join('\n');
      }
    
      lines.push('');
      for (const user of data.invitedUsers) {
        if (user.firstName) {
          lines.push(`${user.firstName} ${user.lastName} (${user.email})`);
          if (user.roles?.length) lines.push(`  Roles: ${user.roles.join(', ')}`);
    
          if (user.devices?.length) {
            for (const d of user.devices) {
              const name = d.deviceName || d.type;
              const status = [
                d.isPaired ? 'paired' : 'not paired',
                d.isEnabled ? 'enabled' : 'disabled',
              ].join(', ');
              lines.push(`  ${name} — ${status}`);
            }
          }
        } else {
          lines.push(`${user.email} (invited, ${user.status})`);
        }
        lines.push('');
      }
    
      return lines.join('\n').trim();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes a read operation ('see'), implying it's likely safe and non-destructive, but doesn't specify authentication requirements, rate limits, or what the output format looks like. For a tool that accesses sensitive vehicle access data, this is a significant gap in transparency.

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?

The description is a single, well-structured sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the main action ('see') and clearly lists the types of access information retrieved. Every part of the sentence earns its place, making it highly concise.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that retrieves sensitive access information. It doesn't explain authentication needs, error conditions, or the structure of the returned data (e.g., list format, fields). For a tool in a security-sensitive context like vehicle access, this leaves critical gaps for an AI agent.

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

Parameters3/5

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

The input schema has 100% description coverage, with the single parameter 'vehicle_id' documented as 'Vehicle ID from your account info.' The description doesn't add any additional semantic context beyond this, such as where to find the vehicle ID or format examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'See who has access to your vehicle — drivers, phone keys, and key fobs.' It specifies the verb ('see') and resource ('access to your vehicle'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like rivian_get_user_info or rivian_get_vehicle_state, which might also provide related information.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing to be logged in via rivian_login), exclusions, or how it complements sibling tools. This lack of context leaves the agent to infer usage based on tool names alone.

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