Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agno.com/llms.txt

Use this file to discover all available pages before exploring further.

Search and read files from Google Drive, including Docs, Sheets, and uploaded files. The provider exposes one tool: query_gdrive.
from agno.agent import Agent
from agno.context.gdrive import GoogleDriveContextProvider

drive = GoogleDriveContextProvider()

agent = Agent(
    model=...,
    tools=drive.get_tools(),
)

agent.print_response("Find the Q4 planning doc and summarize the key milestones")
GoogleDriveContextProvider is read-only. There is no update_gdrive tool.

Authentication

OAuth or service account. For service accounts, share folders with the service account email.
export GOOGLE_CLIENT_ID=...
export GOOGLE_CLIENT_SECRET=...
export GOOGLE_PROJECT_ID=...
Token cached to gdrive_token.json.

Configuration

ParameterTypeDefaultDescription
idstr"gdrive"Tool becomes query_<id>.
corporastr"allDrives"Search scope: "user", "domain", "drive", or "allDrives".
drive_idstrNoneRequired when corpora="drive" (single Shared Drive).
modelModelNoneModel for the sub-agent.
modeContextModedefaultSee Mode.

Tools Exposed

ToolDescription
query_gdriveSearch files, list folders, read file contents (including Google Docs/Sheets).

Shared Drive Support

By default, corpora="allDrives" searches everything the user can access. Narrow the scope:
# Personal Drive only
drive = GoogleDriveContextProvider(corpora="user")

# Single Shared Drive
drive = GoogleDriveContextProvider(corpora="drive", drive_id="0ABcd...")

# All files shared to domain
drive = GoogleDriveContextProvider(corpora="domain")

Example queries

QueryWhat happens
”Find the product roadmap document”Searches by title
”What spreadsheets were modified this week?”Searches with time filter
”Read the meeting notes from the design review”Gets file content

Resources

GoogleDriveTools Example

All methods and OAuth setup

Cookbook Example

Working example