home / skills / aaaaqwq / agi-super-skills / google-web-search

google-web-search skill

/skills/data-scraping/google-web-search

This skill enables real-time web searching via the Gemini API to provide grounded, citable answers with current data.

This is most likely a fork of the google-web-search skill from openclaw
npx playbooks add skill aaaaqwq/agi-super-skills --skill google-web-search

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
2.7 KB
---
name: google-web-search
description: Enables grounded question answering by automatically executing the Google Search tool within Gemini models. Use when the required information is recent (post knowledge cutoff) or requires verifiable citation.
---

# Google Web Search

## Overview

This skill provides the capability to perform real-time web searches via the Gemini API's `google_search` grounding tool. It is designed to fetch the most current information available on the web to provide grounded, citable answers to user queries.

**Key Features:**
- Real-time web search via Gemini API
- Grounded responses with verifiable citations
- Configurable model selection
- Simple Python API

## Usage

This skill exposes the Gemini API's `google_search` tool. It should be used when the user asks for **real-time information**, **recent events**, or requests **verifiable citations**.

### Execution Context

The core logic is in `scripts/example.py`. This script requires the following environment variables:

- **GEMINI_API_KEY** (required): Your Gemini API key
- **GEMINI_MODEL** (optional): Model to use (default: `gemini-2.5-flash-lite`)

**Supported Models:**
- `gemini-2.5-flash-lite` (default) - Fast and cost-effective
- `gemini-3-flash-preview` - Latest flash model
- `gemini-3-pro-preview` - More capable, slower
- `gemini-2.5-flash-lite-preview-09-2025` - Specific version

### Python Tool Implementation Pattern

When integrating this skill into a larger workflow, the helper script should be executed in an environment where the `google-genai` library is available and the `GEMINI_API_KEY` is exposed.

Example Python invocation structure:
```python
from skills.google-web-search.scripts.example import get_grounded_response

# Basic usage (uses default model):
prompt = "What is the latest market trend?"
response_text = get_grounded_response(prompt)
print(response_text)

# Using a specific model:
response_text = get_grounded_response(prompt, model="gemini-3-pro-preview")
print(response_text)

# Or set via environment variable:
import os
os.environ["GEMINI_MODEL"] = "gemini-3-flash-preview"
response_text = get_grounded_response(prompt)
print(response_text)
```

### Troubleshooting

If the script fails:
1. **Missing API Key**: Ensure `GEMINI_API_KEY` is set in the execution environment.
2. **Library Missing**: Verify that the `google-genai` library is installed (`pip install google-generativeai`).
3. **API Limits**: Check the API usage limits on the Google AI Studio dashboard.
4. **Invalid Model**: If you set `GEMINI_MODEL`, ensure it's a valid Gemini model name.
5. **Model Not Supporting Grounding**: Some models may not support the `google_search` tool. Use flash or pro variants.

Overview

This skill enables real-time, grounded question answering by executing the Google Search grounding tool inside Gemini models. It fetches current web information and returns responses with verifiable citations. Use it when answers must reference recent events, data, or sources outside the models knowledge cutoff.

How this skill works

The skill calls the Gemini APIs google_search tool to execute live web searches, then formats the models grounded response with source citations. You provide a prompt and optionally choose a model; the helper returns a concise, citable answer. Environment variables control the API key and default model for easy integration.

When to use it

  • You need information published after the models cutoff date.
  • Answers must include verifiable citations or source links.
  • You want the latest news, market trends, or event updates.
  • Checking facts, figures, or official statements available online.
  • Integrating real-time web grounding into chatbots or reporting pipelines.

Best practices

  • Always set GEMINI_API_KEY in the environment before running the helper script.
  • Start with a clear, specific prompt to reduce noisy search results.
  • Choose a model that supports grounding (flash or pro variants) for reliable tool use.
  • Limit search scope in the prompt (date range, site domain) when you need focused results.
  • Handle API errors and rate limits: implement retries and backoff strategies.

Example use cases

  • Fetch the latest regulatory announcement and return the official source link for compliance teams.
  • Answer a users question about recent earnings calls with cited press releases and summaries.
  • Monitor market-moving headlines and summarize them with direct citations for analysts.
  • Power a customer support assistant that needs to reference live product documentation or advisories.
  • Validate a news claim by returning the top web sources and a brief grounded verdict.

FAQ

Which models support the google_search grounding tool?

Use flash or pro variants such as gemini-2.5-flash-lite, gemini-3-flash-preview, or gemini-3-pro-preview. Some models may not support grounding tools.

What environment variables are required?

Set GEMINI_API_KEY (required). Optionally set GEMINI_MODEL to pick a default model; otherwise the skill uses gemini-2.5-flash-lite.