{"id":9064,"library":"langchain-google-calendar-tools","title":"Google Calendar Tools (Legacy - Use `langchain-google-community[calendar]`)","description":"This package, `langchain-google-calendar-tools` (version 0.0.1), is an early-stage project or demonstration for connecting to the Google Calendar API within LangChain. It appears to be a separate, less maintained effort. For robust and actively supported Google Calendar integrations with LangChain, it is *strongly recommended* to use the `langchain-google-community` package with the `calendar` extra, which provides comprehensive and up-to-date tools for calendar operations. This entry focuses on the requested `langchain-google-calendar-tools` but highlights the recommended alternative.","status":"deprecated","version":"0.0.1","language":"en","source_language":"en","source_url":"https://github.com/sun-asterisk-research/langchain-google-calendar-tools","tags":["langchain","google-calendar","ai-tools","deprecated","community"],"install":[{"cmd":"pip install langchain-google-calendar-tools","lang":"bash","label":"Original (Less Maintained)"},{"cmd":"pip install -qU langchain-google-community[calendar]","lang":"bash","label":"Recommended (Actively Maintained)"}],"dependencies":[{"reason":"Core LangChain framework dependency.","package":"langchain"},{"reason":"Interacts with Google APIs.","package":"google-api-python-client"},{"reason":"Handles Google OAuth2 authentication flow.","package":"google-auth-oauthlib"},{"reason":"Provides HTTP client for Google Auth.","package":"google-auth-httplib2"}],"imports":[{"note":"The `CalendarToolkit` for Google Calendar is provided by the `langchain-google-community` package, not directly by `langchain-google-calendar-tools`. The latter's structure may differ or be incomplete.","wrong":"from langchain_google_calendar_tools import CalendarToolkit","symbol":"CalendarToolkit","correct":"from langchain_google_community import CalendarToolkit"},{"note":"Specific tools like `CalendarCreateEvent` are part of the `langchain-google-community.calendar.tool` module, not the older `langchain-google-calendar-tools` project's specific modules, which might be `langchain_google_calendar_tools.create_event_tool` based on typical patterns if it were a standalone project.","wrong":"from langchain_google_calendar_tools.create_event_tool import CalendarCreateEvent","symbol":"CalendarCreateEvent","correct":"from langchain_google_community.calendar.tool import CalendarCreateEvent"}],"quickstart":{"code":"import os\nimport getpass\n\n# Ensure you have a credentials.json file from Google Cloud Project setup\n# See https://developers.google.com/calendar/api/quickstart/python\n\n# Install the recommended package:\n# pip install -qU langchain-google-community[calendar]\n\nfrom langchain_google_community import CalendarToolkit\nfrom langchain_google_community.calendar.tool import CalendarCreateEvent, CalendarSearchEvents\n\n# Initialize the toolkit. It defaults to reading credentials.json\n# You might need to place credentials.json in the root of your project\n# or specify the path to the credentials file.\n# For custom authentication, refer to LangChain documentation.\n\ntry:\n    toolkit = CalendarToolkit()\n    # You can also use individual tools directly\n    create_event_tool = CalendarCreateEvent()\n    search_events_tool = CalendarSearchEvents()\n\n    print(\"CalendarToolkit initialized successfully.\")\n    # Example: Accessing a tool (this won't run without proper OAuth flow)\n    # For a full example, you would typically integrate with an agent.\n    # print(search_events_tool.name)\n\nexcept Exception as e:\n    print(f\"Error initializing CalendarToolkit: {e}\")\n    print(\"Please ensure 'credentials.json' is correctly set up and OAuth flow is completed.\")\n    print(\"Refer to LangChain's Google Calendar documentation for detailed setup.\")","lang":"python","description":"This quickstart demonstrates the recommended way to initialize the Google Calendar Toolkit and individual tools using `langchain-google-community`. It assumes you have `credentials.json` configured as per Google's OAuth 2.0 Desktop App flow. The toolkit will automatically attempt to use these credentials."},"warnings":[{"fix":"Migrate to `pip install -qU langchain-google-community[calendar]` and update import paths as shown in the quickstart.","message":"The original `langchain-google-calendar-tools` package (v0.0.1) is not actively maintained and has limited functionality. The LangChain ecosystem has moved to `langchain-google-community[calendar]` for Google Calendar integrations.","severity":"breaking","affected_versions":"0.0.1 and potentially other pre-release versions of `langchain-google-calendar-tools`."},{"fix":"Follow the Google Calendar API Python Quickstart (https://developers.google.com/calendar/api/quickstart/python) to set up a Google Cloud Project, enable the Google Calendar API, and download `credentials.json`. Place this file where your application can access it (e.g., project root) or specify its path when initializing the toolkit/tools.","message":"Authentication for Google Calendar tools requires a `credentials.json` file obtained from a Google Cloud Project with the Calendar API enabled, configured for a 'Desktop app' OAuth client. Without correct setup, tools will fail to initialize or perform actions.","severity":"gotcha","affected_versions":"All versions using Google Calendar API."},{"fix":"This is a known issue, often requiring updates to `langchain-google-genai` and underlying `google-auth`, `google-genai` libraries. Ensure all LangChain Google-related packages are up-to-date. If the problem persists, consult the latest LangChain GitHub issues or documentation regarding specific LLM integrations.","message":"When using `langchain-google-community` with some LLMs (e.g., Gemini), an empty `properties` object in tool schemas for tools that don't require parameters can cause `Invalid argument` errors.","severity":"gotcha","affected_versions":"langchain-google-community 2.0.7 and potentially others when used with Gemini models."}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Run `pip install langchain-google-calendar-tools` (for the old package) or `pip install -qU langchain-google-community[calendar]` (recommended for the new one).","cause":"The package `langchain-google-calendar-tools` is not installed or the environment is not activated.","error":"ModuleNotFoundError: No module named 'langchain_google_calendar_tools'"},{"fix":"Ensure you install with the extra: `pip install -qU langchain-google-community[calendar]`.","cause":"The `calendar` extra for `langchain-google-community` was not installed, or the base `langchain-google-community` package is missing.","error":"ModuleNotFoundError: No module named 'langchain_google_community.calendar.tool'"},{"fix":"Obtain `credentials.json` from your Google Cloud Project (ensure Google Calendar API is enabled and OAuth consent screen is configured). Place the file in your project's root directory or explicitly provide its path to the toolkit/tools during initialization.","cause":"The `credentials.json` file, required for Google API authentication, is missing or not located in the expected path.","error":"Error initializing CalendarToolkit: [Errno 2] No such file or directory: 'credentials.json'"},{"fix":"This is often an upstream issue. Ensure `langchain-google-community`, `langchain-google-genai`, and their underlying `google-auth`, `google-genai` dependencies are updated to their latest versions. Sometimes, explicitly defining all possible parameters, even optional ones, or using a different LLM might be temporary workarounds.","cause":"This error can occur when using Gemini models with `langchain-google-community` tools that have implicitly empty parameter schemas, which Gemini's API rejects.","error":"langchain_google_genai.chat_models.ChatGoogleGenerativeAIError: Invalid argument provided to Gemini: 400 * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type"}]}