npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@retinue/tools-google

v0.3.0

Published

Google Workspace tools for a Retinue agent: Gmail, Calendar, Drive, Docs and Sheets — gated, idempotent, and scope-checked before the call.

Downloads

25

Readme

@retinue/tools-google

Gmail and Calendar tools for a Retinue agent.

npm i @retinue/tools-google

Before anything else: this needs a refreshing resolver

A Google access token lives for one hour. Wrap your resolver in withRefreshingCredentials or the toolkit works until lunch and then fails in a way that looks intermittent.

import { withRefreshingCredentials } from "@retinue/agentkit/tools";
import type { CredentialRefresher, CredentialResolver } from "@retinue/agentkit/tools";
import { createGoogleToolkit } from "@retinue/tools-google";

declare const yourResolver: CredentialResolver;
declare const yourRefresher: CredentialRefresher;

const google = createGoogleToolkit({
  credentialRef: "google",
  resolver: withRefreshingCredentials(yourResolver, yourRefresher),
  // The tool most worth excluding, and the one a typo would silently ship.
  exclude: ["gmail_send_message"],
});

Tools

Gmail — gmail_search_messages, gmail_get_message, gmail_get_thread, gmail_list_labels (reads); gmail_send_message, gmail_reply_message, gmail_modify_labels (gated); gmail_create_draft (not gated — see below).

Calendar — calendar_list_events, calendar_get_event, calendar_find_free_time (reads); calendar_create_event, calendar_update_event (gated); calendar_delete_event (destroys).

There is no delete or trash tool for mail. Deleting somebody's email is not a capability this package grants.

Three things worth knowing

The draft is deliberately ungated. Every other write stops for a person; gmail_create_draft does not. If drafting and sending both cost an approval, a model has no reason to prefer drafting — the cheap path and the irreversible path would be equally expensive. Making the reversible act free is what makes it the default.

A missing scope is refused before the call. Each tool declares its scopes, and the toolkit compares them with what the connection was granted. Google's own answer is a 403 naming the API rather than the scope, so a model retries with different arguments forever. When the grant is unstated — a static token with no metadata — it proceeds rather than breaking a working configuration.

Calendar writes email people. Creating an event sends invitations; updating one notifies everyone already on it; deleting one sends cancellations. Every such description says so, so a model can tell that one option is a message to eight people and the other is not.

Requirements

  • Node 20+, @retinue/agentkit as a peer dependency
  • A Google Cloud OAuth app. Gmail's scopes are restricted, which means the app must pass Google's verification — a security assessment taking weeks — before anyone outside your test users can consent. Calendar's are merely sensitive: verification, no assessment. GOOGLE_SCOPES exports which is which.

Full documentation: docs.retinue.riseexperts.de.

MIT