search
Perform web searches using Google Custom Search Engine to find relevant information, filter results by site or date, and customize search parameters for precise query results.
Instructions
Google Programmable Search (CSE) via MCP.
Parameters:
q: Query string. Trimmed; required.
num: Number of results to return (1..10; clamped).
start: 1-based index for pagination start (clamped to >=1).
siteSearch: Limit results to a site (or domain) per CSE rules.
siteSearchFilter: "i" to include or "e" to exclude `siteSearch`.
safe: SafeSearch level: "off" or "active".
gl: Geolocation/country code.
hl: UI language.
lr: Language restrict (e.g., "lang_en").
useSiteRestrict: Use the siterestrict endpoint variant.
dateRestrict: Time filter (e.g., "d7", "m3", "y1").
exactTerms, orTerms, excludeTerms: Query modifiers.
cxOverride: Override the configured CSE ID (avoid echoing to clients).
lean_fields: If True, request a smaller response via fields projection.
Returns:
A dict with keys: provider, query (sanitized), searchInfo, nextPage,
latency_ms, results (normalized), raw (subset), trace (q hash).
Raises:
ValueError: For invalid parameter values (e.g., unsupported safe).
RuntimeError: For Google API errors or network failures.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
cxOverride | No | ||
dateRestrict | No | ||
exactTerms | No | ||
excludeTerms | No | ||
gl | No | ||
hl | No | ||
lean_fields | No | ||
lr | No | ||
num | No | ||
orTerms | No | ||
q | Yes | ||
safe | No | ||
siteSearch | No | ||
siteSearchFilter | No | ||
start | No | ||
useSiteRestrict | No |
Input Schema (JSON Schema)
{
"properties": {
"cxOverride": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Cxoverride"
},
"dateRestrict": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Daterestrict"
},
"exactTerms": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Exactterms"
},
"excludeTerms": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Excludeterms"
},
"gl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Gl"
},
"hl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Hl"
},
"lean_fields": {
"default": true,
"title": "Lean Fields",
"type": "boolean"
},
"lr": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Lr"
},
"num": {
"default": 5,
"title": "Num",
"type": "integer"
},
"orTerms": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Orterms"
},
"q": {
"title": "Q",
"type": "string"
},
"safe": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Safe"
},
"siteSearch": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sitesearch"
},
"siteSearchFilter": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sitesearchfilter"
},
"start": {
"default": 1,
"title": "Start",
"type": "integer"
},
"useSiteRestrict": {
"default": false,
"title": "Usesiterestrict",
"type": "boolean"
}
},
"required": [
"q"
],
"type": "object"
}