Setup
To use this toolkit, you will need to set up your credentials explained in the Gmail API docs. Once you’ve downloaded thecredentials.json file, you can start using the Gmail API.
Installation
This toolkit lives in thelangchain-google-community package. We’ll need the gmail extra:
Instantiation
By default the toolkit reads the localcredentials.json file. You can also manually provide a Credentials object.
Customizing Authentication
Behind the scenes, agoogleapi resource is created using the following methods.
you can manually build a googleapi resource for more auth control.
Tools
View available tools:Use within an agent
Below we show how to incorporate the toolkit into an agent. We will need a LLM or chat model:API reference
For detailed documentation of allGmailToolkit features and configurations head to the API reference.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.