Skip to main content
Integrate Gwiz’s Gmail capabilities directly into your applications using the @gwizai/sdk package. The SDK provides seamless integration with the Vercel AI SDK, enabling AI agents to interact with Gmail.

Installation

Install the SDK using your preferred package manager:
npm install @gwizai/sdk

Integrate with Vercel AI SDK

Install the Vercel AI SDK and a model provider:
npm install ai @ai-sdk/openai
Then integrate Gwiz tools into your agent:
import { tools } from "@gwizai/sdk";
import { Agent } from "ai";
import { openai } from "@ai-sdk/openai";

// Load tools
const gwizTools = await tools();

// Create an agent with Gmail capabilities
const agent = new Agent({
  model: openai("gpt-4"),
  tools: {
    gmail: gwizTools,
  },
});

// Use the agent
const result = await agent.generate({
  messages: [
    {
      role: "user",
      content: "Find my most recent email from [email protected]",
    },
  ],
});

console.log(result.text);

Authentication Options

Environment Variables

Set environment variables for automatic configuration:
export GWIZ_TOKEN="your-token-here"
export GWIZ_URL="https://mcp.gwiz.ai"
Then use the tools() function without any configuration:
import { tools } from "@gwizai/sdk";
const gwizTools = await tools();

Via Construction

Pass your API key directly when creating the client:
import { createGwizMCP } from "@gwizai/sdk";

const client = await createGwizMCP({
  url: "https://mcp.gwiz.ai", // Optional
  token: "your-api-key-here", // Your Gwiz API key
});

const gwizTools = await client.tools();