Guide

Install the OpenClaw Nylas Plugin

Install @nylas/openclaw-nylas-plugin to give OpenClaw native email, calendar, and contact tools with typed schemas, API-key auth, grant discovery, and no exec approvals.

Written by Qasim Muhammad Staff SRE

Reviewed by Hazik

VerifiedCLI 3.1.1 · Gmail, Outlook · last tested April 11, 2026

What is the OpenClaw Nylas Plugin?

The @nylas/openclaw-nylas-plugin package is an npm-based plugin for OpenClaw that provides native tool schemas for email, calendar, and contacts. Instead of using OpenClaw's exec tool to run shell commands (as covered in the CLI exec guide), the plugin registers typed tools directly with the agent.

This means the agent calls tools like nylas_list_emails and nylas_send_email with structured parameters and gets JSON responses back — no command construction, no output parsing, and no exec-approvals.json.

Key advantages over the exec approach:

  • Typed tool schemas — the agent sees parameter names, types, and descriptions, reducing errors
  • Auto-discovery — the plugin finds all grants associated with your API key automatically
  • Multi-account — work with multiple email accounts using named grants
  • No shell security config — no exec-approvals.json, no PATH setup, no allowlists
  • Works with OpenClaw, Moltbot, and Clawdbot

Prerequisites

  • OpenClaw installed and running. See the existing guide for setup instructions.
  • Nylas dashboard account — sign up at dashboard-v3.nylas.com if you don't have one.
  • Nylas API key — create one in the dashboard under Settings → API Keys.
  • At least one grant — connect an email account (Gmail, Outlook, Exchange, Yahoo, iCloud, or IMAP) in the dashboard under Grants.

1. Install the plugin

OpenClaw has a built-in plugin manager. Install the package directly:

openclaw plugins install @nylas/openclaw-nylas-plugin

This downloads the package from npm and registers it with OpenClaw in under 30 seconds. After installation, restart the gateway so the new plugin is loaded.

Verify the installation:

openclaw plugins list
openclaw gateway restart

You should see @nylas/openclaw-nylas-plugin in the output.

Newer OpenClaw versions sandbox plugins by default. Trust the plugin and expose its tools to agent sessions before configuring credentials:

# Trust the plugin and expose its tools to agent sessions
openclaw config set 'plugins.allow' '["nylas"]'
openclaw config set 'tools.alsoAllow' '["nylas"]'

Skip this on older OpenClaw releases that allow all installed plugins by default — the config keys are no-ops if the runtime does not enforce them.

2. Configure your API key

The plugin needs your Nylas API key to authenticate. Set it via OpenClaw's config:

openclaw config set 'plugins.entries.nylas.config.apiKey' 'YOUR_NYLAS_API_KEY'
openclaw gateway restart

Alternatively, set the NYLAS_API_KEY environment variable in your shell profile or OpenClaw's environment config.

If you want named multi-account aliases instead of relying on auto-discovery, configure them explicitly:

openclaw config set 'plugins.entries.nylas.config.grants' '{"work":"grant-id-1","personal":"grant-id-2"}'
openclaw gateway restart

3. Verify it works

Verify the plugin is loaded and can see your connected accounts:

# Check the plugin is loaded
openclaw plugins list

# Verify grant discovery through the plugin
openclaw run "List my connected email accounts" --plugin nylas

The plugin auto-discovers grants linked to your API key at startup. If you add grants later, restart the gateway before verifying again.

4. What tools does the plugin provide?

Once installed, the plugin registers 16 native tools across four domains — email, calendar, contacts, and grant discovery:

Email tools

ToolDescription
nylas_list_emailsList recent messages with optional filters
nylas_get_emailRead a specific message by ID
nylas_send_emailSend an email
nylas_create_draftCreate a draft message
nylas_list_threadsList email threads
nylas_list_foldersList mailbox folders/labels

Calendar tools

ToolDescription
nylas_list_calendarsList all calendars
nylas_list_eventsList calendar events
nylas_get_eventGet a specific calendar event
nylas_create_eventCreate a calendar event
nylas_update_eventUpdate an existing event
nylas_delete_eventDelete a calendar event
nylas_check_availabilityCheck free/busy availability

Contacts tools

ToolDescription
nylas_list_contactsList contacts with optional search filters
nylas_get_contactGet a specific contact by ID

Discovery tools

ToolDescription
nylas_discover_grantsAuto-discover grants connected to the configured API key

5. Example conversations

Once the plugin is installed and configured, here are realistic prompts and the tool calls the agent makes under the hood:

Email examples

  • "What are my unread emails?" — the agent calls nylas_list_emails with { unread: true, limit: 20 }, then summarizes senders, subjects, and snippets.
  • "Find emails from Sarah about the Q4 budget" — the agent calls nylas_list_emails with { query: "from:sarah Q4 budget" }, reads the matching threads, and pulls out the key points.
  • "Draft a reply to the latest email from Dave saying I'll review it by Friday" — the agent calls nylas_list_emails to find Dave's email, then nylas_create_draft with the reply content. It shows you the draft before sending.
  • "Send Alice the meeting notes from yesterday" — the agent calls nylas_list_contacts with a search query to resolve Alice's email address, composes the message, confirms with you, then calls nylas_send_email.

Calendar examples

  • "What's on my calendar this week?" — the agent calls nylas_list_events with start and end timestamps for the current week, then summarizes each day's schedule.
  • "Schedule a 30-minute meeting with bob@company.com on Tuesday at 2pm" — the agent calls nylas_create_event with the title, participants, start time, and duration. It confirms the event details before creating it.
  • "Am I free Thursday afternoon?" — the agent calls nylas_check_availability for Thursday 12:00–18:00 and tells you which slots are open.
  • "Move my 3pm meeting to 4pm" — the agent calls nylas_list_events to find the 3pm event, then nylas_update_event to shift the start and end times by one hour.

Contacts examples

  • "What's Sarah Chen's email address?" — the agent calls nylas_list_contacts with { query: "Sarah Chen" } and returns the matching contact details.
  • "Look up everyone from Acme Corp in my contacts" — the agent calls nylas_list_contacts with { query: "Acme Corp" } and lists all matching names and email addresses.

Combined workflow examples

  • "Find a time to meet with alice@company.com this week and send her an invite" — the agent calls nylas_check_availability to check both calendars, picks the first open slot, calls nylas_create_event with Alice as a participant, and confirms the invite was sent.
  • "Check if I have any emails from the attendees of tomorrow's standup" — the agent calls nylas_list_events to find tomorrow's standup and its participants, then calls nylas_list_emails with targeted queries for each attendee to surface recent threads.
  • "Email everyone in my 2pm meeting that I'll be 10 minutes late" — the agent calls nylas_list_events to find the 2pm event, extracts the participant emails, composes a short message, confirms with you, then calls nylas_send_email for the outgoing message.

6. How do I use multiple email accounts?

If your API key has multiple grants (for example, a work Gmail and a personal Outlook account), the plugin supports named aliases. Configure the aliases in OpenClaw's config:

openclaw config set 'plugins.entries.nylas.config.grants' '{"work":"grant-id-1","personal":"grant-id-2"}'
openclaw gateway restart

With aliases configured, the plugin can target a specific account by name instead of a raw grant ID. If you do not configure aliases, the plugin auto-discovers grants from your Nylas application at startup.

The agent can then specify which account to use when calling tools. For example, "list my work emails" versus "send from my personal account."

7. Optional: Standalone usage

You can also use the plugin as a standalone npm package in your own TypeScript or JavaScript projects, outside of OpenClaw:

npm install @nylas/openclaw-nylas-plugin
import { createNylasClient } from "@nylas/openclaw-nylas-plugin"

const { client, discovered } = await createNylasClient({
  apiKey: process.env.NYLAS_API_KEY!,
})

console.log(`Discovered ${discovered.length} grants`)

const emails = await client.listMessages({ limit: 5 })
console.log(emails)

This is useful if you're building a custom agent with the agent tools guide pattern and want typed Nylas tools without the CLI.

8. Which approach should I choose: plugin, CLI exec, or MCP?

There are three ways to give an OpenClaw agent Nylas access. Here's how they compare:

FeaturePlugin (this guide)CLI execMCP server
Setup complexityOne commandPATH + exec-approvalsConfig + running process
Tool schemasTyped (auto-registered)Text in TOOLS.mdTyped (MCP protocol)
Auth methodAPI keyCLI OAuthCLI OAuth
Multi-accountNamed grantsSingle grantSingle grant
Auto-discoveryYesNoNo
Shell access neededNoYesNo
Requires running processNoNoYes

Recommendation: Use the plugin for the simplest setup and best multi-account support. Use the CLI exec approach if you already have the Nylas CLI authenticated and prefer OAuth-based auth. Use MCP if you need the same tools available to other MCP-compatible clients (Claude Desktop, Cursor, VS Code).

Troubleshooting

"apiKey is required"

The plugin cannot find your API key. Make sure you set it with openclaw config set 'plugins.entries.nylas.config.apiKey' or via the NYLAS_API_KEY environment variable. Check that the value is not empty:

openclaw config get 'plugins.entries.nylas.config.apiKey'

"No grants found"

Your API key has no connected email accounts. Go to dashboard-v3.nylas.comGrants and connect at least one email account. Then restart the gateway and verify the plugin again.

openclaw gateway restart
openclaw run "List my connected email accounts" --plugin nylas

401 Unauthorized

The API key is invalid or expired. Generate a new one in the Nylas dashboard under Settings → API Keys and update it:

openclaw config set 'plugins.entries.nylas.config.apiKey' 'NEW_API_KEY'
openclaw gateway restart

404 Not Found on grant operations

A named grant alias or raw grant ID is stale. Update plugins.entries.nylas.config.grants to point at valid grant IDs from your Nylas dashboard, then restart the gateway.

Plugin not showing up

If openclaw plugins list does not show the plugin, try reinstalling:

openclaw plugins uninstall @nylas/openclaw-nylas-plugin
openclaw plugins install @nylas/openclaw-nylas-plugin
openclaw config set 'plugins.allow' '["nylas"]'
openclaw config set 'tools.alsoAllow' '["nylas"]'
openclaw gateway restart

If the plugin is listed but its tools never appear in agent sessions, the plugin is installed but not trusted. Run the two openclaw config set commands above and restart the gateway.

Next steps