Skip to content

How to install the OpenClaw Nylas plugin

The @nylas/openclaw-nylas-plugin gives OpenClaw agents access to the Nylas API for email, calendar, and contacts. Once installed, your agents can send email, create calendar events, search contacts, and manage messages across Gmail, Outlook, Exchange, and any IMAP provider through a unified set of tools.

The plugin handles grant discovery automatically, so agents can work with multiple connected accounts without hardcoding grant IDs.

  1. Create Nylas account - Sign up at dashboard-v3.nylas.com
  2. Create application - All apps > Create new app > Choose region (US/EU)
  3. Get API key - API Keys section > Create new key
  4. Add grants - Grants section > Add Account > Authenticate your email accounts
  5. Grant IDs are auto-discovered - The plugin resolves them from just the API key

You can install the plugin through the OpenClaw CLI or directly with npm.

The plugin needs your Nylas API key to authenticate requests. You can configure it through the OpenClaw CLI or environment variables.

Set your API key and optional settings through the OpenClaw config:

If you’re using the plugin directly with npm (outside of OpenClaw), set these environment variables:

VariableRequiredDescription
NYLAS_API_KEYYesYour API key from the Nylas Dashboard
NYLAS_GRANT_IDNoExplicit grant ID (skip auto-discovery)
NYLAS_API_URINoAPI region endpoint (defaults to https://api.us.nylas.com)
NYLAS_TIMEZONENoDefault timezone for calendar operations (defaults to UTC)

The plugin supports multiple connected accounts (grants) through named aliases. This lets agents reference accounts by name instead of raw grant IDs.

Once configured, agents can target a specific account by name when calling any tool:

If you don’t configure named grants, the plugin auto-discovers available grants from your Nylas application.

After installation, the plugin exposes these tools to your OpenClaw agents:

ToolDescription
nylas_list_emailsList email messages with optional filters (folder, date range, search)
nylas_get_emailRetrieve a single message by ID, including full body and attachments
nylas_send_emailSend an email with recipients, subject, body, and optional attachments
nylas_create_draftCreate a draft message without sending
nylas_list_threadsList email threads with filters
nylas_list_foldersList all folders and labels for the connected account
ToolDescription
nylas_list_calendarsList all calendars for the connected account
nylas_list_eventsList calendar events with optional date range and calendar filters
nylas_get_eventRetrieve a single event by ID
nylas_create_eventCreate a new calendar event with title, time, participants, and location
nylas_update_eventUpdate an existing event
nylas_delete_eventDelete a calendar event
nylas_check_availabilityCheck free/busy availability for one or more participants
ToolDescription
nylas_list_contactsList contacts with optional search query
nylas_get_contactRetrieve a single contact by ID
ToolDescription
nylas_discover_grantsAuto-discover available grants (connected accounts) for your application

After installing and configuring the plugin, verify it’s working:

You can also verify programmatically:

  • Auto-discovery queries all grants on your Nylas application at startup. If you have many grants, set NYLAS_GRANT_ID or use named grants to skip discovery and reduce startup time.
  • Rate limits apply per grant, not per plugin instance. If multiple agents share the same grant, they share the same rate limit budget. See Rate limits best practices for details.
  • The plugin uses Nylas API v3. All tool calls go through the Nylas v3 REST API, so provider-specific behaviors (folder naming, sync timing, search syntax) are the same as documented in the provider guides.
  • TypeScript types are included. If you’re extending the plugin or building custom tools on top of it, you get full type safety for all Nylas objects (messages, events, contacts, grants).
  • MoltBot compatibility is built in. The plugin works as both a standalone Node.js client and as an OpenClaw/MoltBot gateway plugin.