@serpbit/ai-sdk 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Serpbit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @serpbit/ai-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Google as tools for the [Vercel AI SDK](https://ai-sdk.dev): Search with the AI Overview and the first pages' text,
4
+ News, Shopping and each product's offers, Images, Videos, Maps, Autocomplete and AI Mode, served by
5
+ [Serpbit](https://serpbit.com) from Google's own results pages.
6
+
7
+ ```sh
8
+ npm install @serpbit/ai-sdk ai
9
+ ```
10
+
11
+ Make a key at https://app.serpbit.com/keys and set `SERPBIT_API_KEY`.
12
+
13
+ ```js
14
+ import { generateText, isStepCount } from "ai";
15
+ import { serpbitTools } from "@serpbit/ai-sdk";
16
+
17
+ const { text } = await generateText({
18
+ model: "openai/gpt-5-mini",
19
+ prompt: "Which espresso grinders do German reviewers rate best this year? Cite the pages.",
20
+ tools: serpbitTools(),
21
+ stopWhen: isStepCount(5),
22
+ });
23
+ ```
24
+
25
+ `serpbitTools()` gives all nine tools, named as the [Serpbit MCP server](https://serpbit.com/docs/#mcp) names them:
26
+ `google_search`, `google_news`, `google_shopping`, `google_shopping_product`, `google_images`, `google_videos`,
27
+ `google_maps`, `google_autocomplete` and `google_ai_mode`. Their descriptions and arguments are the MCP server's
28
+ too, so a model meets the same tools either way. To give a model fewer, name them, or take one tool alone:
29
+
30
+ ```js
31
+ import { serpbitTools, googleSearch } from "@serpbit/ai-sdk";
32
+
33
+ const tools = serpbitTools({ tools: ["google_search", "google_news"], params: { gl: "de", hl: "de" } });
34
+ const search = googleSearch({ apiKey: process.env.MY_SERPBIT_KEY });
35
+ ```
36
+
37
+ - `params` are sent with every call: `gl`, `hl`, `location` and any other parameter of the
38
+ [API](https://serpbit.com/docs/). The model's own arguments win over them.
39
+ - A tool answers in Markdown, compact for a model to read. The model can ask for `format: "json"` to get every field.
40
+ - With `content: N`, `google_search` and `google_news` also read the first N results' pages and give their text,
41
+ 6,000 characters a page unless the model asks for more with `content_chars`.
42
+ - A refusal is thrown as the [`serpbit`](https://www.npmjs.com/package/serpbit) client's error (`InsufficientCreditsError`,
43
+ `RateLimitError`…), so the model sees an error, not an empty search.
44
+
45
+ Each tool's description says what it costs: a search is 1 credit a page, a page read 1 more, Shopping and Images 2 a
46
+ page, an AI Mode answer 2. A failed call is free. The free plan gives 1,000 credits a month, with no card.
47
+
48
+ The AI SDK 5, 6 or 7; Node 18 or later (the AI SDK 7 wants Node 22).
package/index.d.ts ADDED
@@ -0,0 +1,142 @@
1
+ import type { Tool } from "ai";
2
+ import type { ParamValue, Serpbit } from "serpbit";
3
+
4
+ export declare const VERSION: string;
5
+
6
+ export type GoogleToolName =
7
+ | "google_search"
8
+ | "google_news"
9
+ | "google_shopping"
10
+ | "google_shopping_product"
11
+ | "google_images"
12
+ | "google_videos"
13
+ | "google_maps"
14
+ | "google_autocomplete"
15
+ | "google_ai_mode";
16
+
17
+ export declare const TOOL_NAMES: GoogleToolName[];
18
+
19
+ /** The tools' definitions, as the MCP server's tools/list gives them, with the API path each one calls. */
20
+ export declare const TOOLS: Array<{
21
+ name: GoogleToolName;
22
+ title: string;
23
+ description: string;
24
+ path: string;
25
+ inputSchema: Record<string, unknown>;
26
+ }>;
27
+
28
+ export interface SerpbitToolOptions {
29
+ /** Defaults to the SERPBIT_API_KEY environment variable (keys are made at https://app.serpbit.com/keys). */
30
+ apiKey?: string;
31
+ /** Defaults to SERPBIT_BASE_URL, then https://api.serpbit.com. */
32
+ baseURL?: string;
33
+ /** A client of your own, used instead of apiKey and baseURL. */
34
+ client?: Serpbit;
35
+ /** Parameters sent with every call (gl, hl, location...); the model's own arguments win. */
36
+ params?: Record<string, ParamValue>;
37
+ }
38
+
39
+ /** Markdown by default (compact for a model to read); json gives every field. */
40
+ export type Format = "markdown" | "json";
41
+
42
+ interface Located {
43
+ gl?: string;
44
+ hl?: string;
45
+ location?: string;
46
+ format?: Format;
47
+ }
48
+
49
+ export interface GoogleSearchInput extends Located {
50
+ q: string;
51
+ device?: "desktop" | "mobile" | "iphone" | "ipad";
52
+ pages?: number;
53
+ start?: number;
54
+ tbs?: string;
55
+ ai_overview?: boolean;
56
+ safe?: "off" | "active";
57
+ lr?: string;
58
+ content?: number;
59
+ content_chars?: number;
60
+ }
61
+ export interface GoogleNewsInput extends Located {
62
+ q: string;
63
+ pages?: number;
64
+ start?: number;
65
+ tbs?: string;
66
+ sort?: "relevance" | "date";
67
+ content?: number;
68
+ content_chars?: number;
69
+ }
70
+ export interface GoogleShoppingInput extends Located {
71
+ q: string;
72
+ device?: "desktop" | "mobile" | "iphone" | "ipad";
73
+ pages?: number;
74
+ shoprs?: string;
75
+ }
76
+ export interface GoogleShoppingProductInput {
77
+ product_id?: string;
78
+ url?: string;
79
+ more_stores?: number;
80
+ format?: Format;
81
+ }
82
+ export interface GoogleImagesInput extends Located {
83
+ q: string;
84
+ pages?: number;
85
+ size?: "large" | "medium" | "icon";
86
+ color?: string;
87
+ type?: "photo" | "clipart" | "lineart" | "animated" | "face";
88
+ license?: "creative_commons" | "commercial";
89
+ aspect?: "tall" | "square" | "wide" | "panoramic";
90
+ }
91
+ export interface GoogleVideosInput extends Located {
92
+ q: string;
93
+ pages?: number;
94
+ tbs?: string;
95
+ duration?: "short" | "medium" | "long";
96
+ }
97
+ export interface GoogleMapsInput extends Located {
98
+ q: string;
99
+ start?: number;
100
+ }
101
+ export interface GoogleAutocompleteInput {
102
+ q: string;
103
+ gl?: string;
104
+ hl?: string;
105
+ client?: "chrome" | "gws-wiz";
106
+ format?: Format;
107
+ }
108
+ export interface GoogleAiModeInput extends Located {
109
+ q: string;
110
+ }
111
+
112
+ /** A tool's answer: Markdown text, or the API's JSON with format "json". */
113
+ export type Answer = string | Record<string, unknown>;
114
+
115
+ export declare function googleSearch(options?: SerpbitToolOptions): Tool<GoogleSearchInput, Answer>;
116
+ export declare function googleNews(options?: SerpbitToolOptions): Tool<GoogleNewsInput, Answer>;
117
+ export declare function googleShopping(options?: SerpbitToolOptions): Tool<GoogleShoppingInput, Answer>;
118
+ export declare function googleShoppingProduct(options?: SerpbitToolOptions): Tool<GoogleShoppingProductInput, Answer>;
119
+ export declare function googleImages(options?: SerpbitToolOptions): Tool<GoogleImagesInput, Answer>;
120
+ export declare function googleVideos(options?: SerpbitToolOptions): Tool<GoogleVideosInput, Answer>;
121
+ export declare function googleMaps(options?: SerpbitToolOptions): Tool<GoogleMapsInput, Answer>;
122
+ export declare function googleAutocomplete(options?: SerpbitToolOptions): Tool<GoogleAutocompleteInput, Answer>;
123
+ export declare function googleAiMode(options?: SerpbitToolOptions): Tool<GoogleAiModeInput, Answer>;
124
+
125
+ export interface SerpbitTools {
126
+ google_search: Tool<GoogleSearchInput, Answer>;
127
+ google_news: Tool<GoogleNewsInput, Answer>;
128
+ google_shopping: Tool<GoogleShoppingInput, Answer>;
129
+ google_shopping_product: Tool<GoogleShoppingProductInput, Answer>;
130
+ google_images: Tool<GoogleImagesInput, Answer>;
131
+ google_videos: Tool<GoogleVideosInput, Answer>;
132
+ google_maps: Tool<GoogleMapsInput, Answer>;
133
+ google_autocomplete: Tool<GoogleAutocompleteInput, Answer>;
134
+ google_ai_mode: Tool<GoogleAiModeInput, Answer>;
135
+ }
136
+
137
+ /** All the Google tools, keyed by name, on one client; `tools` keeps only those named. */
138
+ export declare function serpbitTools<N extends GoogleToolName = GoogleToolName>(
139
+ options?: SerpbitToolOptions & { tools?: N[] },
140
+ ): Pick<SerpbitTools, N>;
141
+
142
+ export default serpbitTools;
package/index.js ADDED
@@ -0,0 +1,79 @@
1
+ // Google as tools for the Vercel AI SDK, through Serpbit: the MCP server's Google tools (tools.js, generated from
2
+ // internal/httpapi/mcp.go) with the same names, descriptions and arguments, each one the API call of the same name.
3
+ // Answers come as Markdown, compact for a model to read, or as JSON with format "json", as the MCP server gives them.
4
+ import { jsonSchema, tool } from "ai";
5
+ import { Serpbit } from "serpbit";
6
+ import { TOOLS } from "./tools.js";
7
+
8
+ export const VERSION = "0.1.1";
9
+
10
+ // A page read's most characters when the model names none: a model's context is smaller than an API client's buffer
11
+ // (the MCP server's mcpReadChars).
12
+ const READ_CHARS = 6000;
13
+
14
+ const byName = new Map(TOOLS.map((t) => [t.name, t]));
15
+
16
+ /** The tools' definitions: name, title, description, the API path each calls, and its input's JSON Schema. */
17
+ export { TOOLS };
18
+
19
+ /** The names of the tools, as the MCP server names them. */
20
+ export const TOOL_NAMES = TOOLS.map((t) => t.name);
21
+
22
+ function clientOf({ client, apiKey, baseURL } = {}) {
23
+ return client ?? new Serpbit({ apiKey, baseURL });
24
+ }
25
+
26
+ function make(name, options = {}, client = clientOf(options)) {
27
+ const def = byName.get(name);
28
+ const defaults = options.params ?? {};
29
+ return tool({
30
+ description: def.description,
31
+ inputSchema: jsonSchema(def.inputSchema),
32
+ execute: async (args, { abortSignal } = {}) => {
33
+ const { format = "markdown", ...rest } = { ...defaults, ...args };
34
+ if (format !== "markdown" && format !== "json") throw new TypeError("format is markdown or json");
35
+ const params = { ...rest };
36
+ if (params.content != null && params.content !== false && params.content_chars == null) params.content_chars = READ_CHARS;
37
+ if (format === "markdown") params.output = "md";
38
+ // The client hears a signal's abort event, so one aborted before the call would go unheard.
39
+ abortSignal?.throwIfAborted();
40
+ // A refusal (no credits, a bad argument, the rate limit) is thrown: the model sees it as the tool's error rather
41
+ // than as a search that found nothing.
42
+ return client.request(def.path, { ...params, signal: abortSignal });
43
+ },
44
+ });
45
+ }
46
+
47
+ /** Google Search: the results page, the AI Overview with ai_overview, and the first pages' text with content. */
48
+ export const googleSearch = (options) => make("google_search", options);
49
+ /** Google's News tab. */
50
+ export const googleNews = (options) => make("google_news", options);
51
+ /** Google's Shopping tab: products with price, store, rating and a product_id. */
52
+ export const googleShopping = (options) => make("google_shopping", options);
53
+ /** One Google Shopping product and every store's offer for it. */
54
+ export const googleShoppingProduct = (options) => make("google_shopping_product", options);
55
+ /** Google Images: about 100 pictures a page. */
56
+ export const googleImages = (options) => make("google_images", options);
57
+ /** Google's Videos tab. */
58
+ export const googleVideos = (options) => make("google_videos", options);
59
+ /** Places as Google Maps lists them. */
60
+ export const googleMaps = (options) => make("google_maps", options);
61
+ /** Google's search-box suggestions. */
62
+ export const googleAutocomplete = (options) => make("google_autocomplete", options);
63
+ /** Google's AI Mode answer, with the sources it cites. */
64
+ export const googleAiMode = (options) => make("google_ai_mode", options);
65
+
66
+ /**
67
+ * All the Google tools as an object for generateText's `tools`, keyed by the MCP server's names (google_search,
68
+ * google_news...), on one client. `tools` keeps only those named, like the MCP server's ?tools=.
69
+ */
70
+ export function serpbitTools({ tools: only, ...options } = {}) {
71
+ const names = only ?? TOOL_NAMES;
72
+ for (const n of names) {
73
+ if (!byName.has(n)) throw new TypeError(`unknown tool ${n}; the tools are ${TOOL_NAMES.join(", ")}`);
74
+ }
75
+ const client = clientOf(options);
76
+ return Object.fromEntries(names.map((n) => [n, make(n, options, client)]));
77
+ }
78
+
79
+ export default serpbitTools;
package/package.json CHANGED
@@ -1,6 +1,35 @@
1
1
  {
2
2
  "name": "@serpbit/ai-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Google Search, News, Shopping, Images, Videos, Maps, Autocomplete and AI Mode as tools for the Vercel AI SDK, through Serpbit.",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./index.d.ts",
9
+ "default": "./index.js"
10
+ }
11
+ },
12
+ "main": "./index.js",
13
+ "types": "./index.d.ts",
14
+ "files": ["index.js", "index.d.ts", "tools.js", "README.md", "LICENSE"],
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "scripts": {
19
+ "test": "node --test test/tools.test.js"
20
+ },
21
+ "dependencies": {
22
+ "serpbit": "^0.3.0"
23
+ },
24
+ "peerDependencies": {
25
+ "ai": ">=5.0.0 <8.0.0"
26
+ },
27
+ "keywords": ["ai-sdk", "vercel ai sdk", "ai", "google search", "serp api", "web search", "ai agents", "tools"],
28
+ "homepage": "https://serpbit.com/docs/#ai-sdk",
29
+ "bugs": {
30
+ "email": "support@serpbit.com"
31
+ },
32
+ "author": "Serpbit <support@serpbit.com>",
33
+ "license": "MIT",
34
+ "sideEffects": false
35
+ }
package/tools.js ADDED
@@ -0,0 +1,537 @@
1
+ // Generated from internal/httpapi/mcp.go by TestAISDKToolsAreMCPs (SERPBIT_UPDATE_TOOLS=1 go test): the MCP
2
+ // server's Google tools, with the same names, descriptions, paths and input schemas.
3
+ export const TOOLS = [
4
+ {
5
+ "description": "Searches Google and returns the results page: organic results with links and snippets, People also ask, top stories, related searches, the knowledge panel, and the AI Overview when ai_overview is true; with content, also the main text of the first results' pages. The tool for general questions about the web. For one kind of result use google_news, google_images, google_videos, google_shopping or google_maps; for Google's written answer, google_ai_mode. pages asks pages 1 to N in one call, start one later page alone; the two do not combine. 1 credit per page, and 1 per page read.",
6
+ "inputSchema": {
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "ai_overview": {
10
+ "description": "Also return Google's AI Overview when the page has one.",
11
+ "type": "boolean"
12
+ },
13
+ "content": {
14
+ "description": "Also read the first N results' pages and give their main text as Markdown: 1 credit per page read, none for a page that could not be read.",
15
+ "maximum": 10,
16
+ "minimum": 1,
17
+ "type": "integer"
18
+ },
19
+ "content_chars": {
20
+ "description": "The most characters of each page's text. Default 6000 here.",
21
+ "maximum": 100000,
22
+ "minimum": 500,
23
+ "type": "integer"
24
+ },
25
+ "device": {
26
+ "description": "The device the page is asked as. Default desktop.",
27
+ "enum": [
28
+ "desktop",
29
+ "mobile",
30
+ "iphone",
31
+ "ipad"
32
+ ],
33
+ "type": "string"
34
+ },
35
+ "format": {
36
+ "description": "markdown (default, compact for reading) or json (every field).",
37
+ "enum": [
38
+ "markdown",
39
+ "json"
40
+ ],
41
+ "type": "string"
42
+ },
43
+ "gl": {
44
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
45
+ "type": "string"
46
+ },
47
+ "hl": {
48
+ "description": "Interface language, e.g. en, de, ja. Default en.",
49
+ "type": "string"
50
+ },
51
+ "location": {
52
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
53
+ "type": "string"
54
+ },
55
+ "lr": {
56
+ "description": "Only results in these languages: lang_de, or up to five joined by |.",
57
+ "type": "string"
58
+ },
59
+ "pages": {
60
+ "description": "Pages 1 to N in one call; each page costs its credits.",
61
+ "maximum": 10,
62
+ "minimum": 1,
63
+ "type": "integer"
64
+ },
65
+ "q": {
66
+ "description": "The search query.",
67
+ "type": "string"
68
+ },
69
+ "safe": {
70
+ "description": "SafeSearch.",
71
+ "enum": [
72
+ "off",
73
+ "active"
74
+ ],
75
+ "type": "string"
76
+ },
77
+ "start": {
78
+ "description": "One later page by itself: 10 is page 2, up to 190.",
79
+ "maximum": 190,
80
+ "minimum": 0,
81
+ "type": "integer"
82
+ },
83
+ "tbs": {
84
+ "description": "Time range: qdr:h, qdr:d, qdr:w, qdr:m or qdr:y, or dates as cdr:1,cd_min:M/D/YYYY,cd_max:M/D/YYYY.",
85
+ "type": "string"
86
+ }
87
+ },
88
+ "required": [
89
+ "q"
90
+ ],
91
+ "type": "object"
92
+ },
93
+ "name": "google_search",
94
+ "path": "/v1/search",
95
+ "title": "Google Search"
96
+ },
97
+ {
98
+ "description": "Searches Google's News tab and returns articles with their publisher, date (and published_at in UTC), snippet and story_id, which is the same on every article of one story; with content=N, also the first N articles' text as Markdown. Use it for news and recent events, or to follow one story across publishers; for the web at large use google_search, and for a written answer, google_ai_mode. sort=date puts the newest first and tbs limits the time (qdr:d is the past day). pages asks pages 1 to N in one call, start one later page alone; the two do not combine. 1 credit per page and 1 per article read; failed calls are free.",
99
+ "inputSchema": {
100
+ "additionalProperties": false,
101
+ "properties": {
102
+ "content": {
103
+ "description": "Also read the first N results' pages and give their main text as Markdown: 1 credit per page read, none for a page that could not be read.",
104
+ "maximum": 10,
105
+ "minimum": 1,
106
+ "type": "integer"
107
+ },
108
+ "content_chars": {
109
+ "description": "The most characters of each page's text. Default 6000 here.",
110
+ "maximum": 100000,
111
+ "minimum": 500,
112
+ "type": "integer"
113
+ },
114
+ "format": {
115
+ "description": "markdown (default, compact for reading) or json (every field).",
116
+ "enum": [
117
+ "markdown",
118
+ "json"
119
+ ],
120
+ "type": "string"
121
+ },
122
+ "gl": {
123
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
124
+ "type": "string"
125
+ },
126
+ "hl": {
127
+ "description": "Interface language, e.g. en, de, ja. Default en.",
128
+ "type": "string"
129
+ },
130
+ "location": {
131
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
132
+ "type": "string"
133
+ },
134
+ "pages": {
135
+ "description": "Pages 1 to N in one call; each page costs its credits.",
136
+ "maximum": 10,
137
+ "minimum": 1,
138
+ "type": "integer"
139
+ },
140
+ "q": {
141
+ "description": "The search query.",
142
+ "type": "string"
143
+ },
144
+ "sort": {
145
+ "description": "relevance (default) or date, newest first.",
146
+ "enum": [
147
+ "relevance",
148
+ "date"
149
+ ],
150
+ "type": "string"
151
+ },
152
+ "start": {
153
+ "description": "One later page by itself: 10 is page 2, up to 190.",
154
+ "maximum": 190,
155
+ "minimum": 0,
156
+ "type": "integer"
157
+ },
158
+ "tbs": {
159
+ "description": "Time range: qdr:h, qdr:d, qdr:w, qdr:m or qdr:y, or dates as cdr:1,cd_min:M/D/YYYY,cd_max:M/D/YYYY.",
160
+ "type": "string"
161
+ }
162
+ },
163
+ "required": [
164
+ "q"
165
+ ],
166
+ "type": "object"
167
+ },
168
+ "name": "google_news",
169
+ "path": "/v1/news",
170
+ "title": "Google News"
171
+ },
172
+ {
173
+ "description": "Searches Google's Shopping tab and returns products, without sponsored ones, each with price, store, rating, reviews, delivery and a product_id, plus the tab's filters (price ranges, brands...). Use it to find products and compare them across the market; then, for every store's offer on one product, pass its product_id to google_shopping_product. To apply a filter, call again with that option's q and shoprs together, both taken from filters. 2 credits per page; failed calls are free.",
174
+ "inputSchema": {
175
+ "additionalProperties": false,
176
+ "properties": {
177
+ "device": {
178
+ "description": "The device the page is asked as. Default desktop.",
179
+ "enum": [
180
+ "desktop",
181
+ "mobile",
182
+ "iphone",
183
+ "ipad"
184
+ ],
185
+ "type": "string"
186
+ },
187
+ "format": {
188
+ "description": "markdown (default, compact for reading) or json (every field).",
189
+ "enum": [
190
+ "markdown",
191
+ "json"
192
+ ],
193
+ "type": "string"
194
+ },
195
+ "gl": {
196
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
197
+ "type": "string"
198
+ },
199
+ "hl": {
200
+ "description": "Interface language, e.g. en, de, ja. Default en.",
201
+ "type": "string"
202
+ },
203
+ "location": {
204
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
205
+ "type": "string"
206
+ },
207
+ "pages": {
208
+ "description": "Pages 1 to N in one call; each page costs its credits.",
209
+ "maximum": 10,
210
+ "minimum": 1,
211
+ "type": "integer"
212
+ },
213
+ "q": {
214
+ "description": "The search query.",
215
+ "type": "string"
216
+ },
217
+ "shoprs": {
218
+ "description": "A filter's token from an earlier answer's filters; send it with that option's q.",
219
+ "type": "string"
220
+ }
221
+ },
222
+ "required": [
223
+ "q"
224
+ ],
225
+ "type": "object"
226
+ },
227
+ "name": "google_shopping",
228
+ "path": "/v1/shopping",
229
+ "title": "Google Shopping"
230
+ },
231
+ {
232
+ "description": "Returns one Google Shopping product and every store's offer for it: price, delivery, total, condition and link. Use it after google_shopping to compare the stores for one product: pass that product's product_id, or its Google Shopping url; one of the two is needed. To find products, use google_shopping. more_stores presses More stores, ten stores a press (default 3, up to 15). US buyers, English. 1 credit.",
233
+ "inputSchema": {
234
+ "additionalProperties": false,
235
+ "properties": {
236
+ "format": {
237
+ "description": "markdown (default, compact for reading) or json (every field).",
238
+ "enum": [
239
+ "markdown",
240
+ "json"
241
+ ],
242
+ "type": "string"
243
+ },
244
+ "more_stores": {
245
+ "description": "Presses of More stores, ten stores each. Default 3.",
246
+ "maximum": 15,
247
+ "minimum": 0,
248
+ "type": "integer"
249
+ },
250
+ "product_id": {
251
+ "description": "The product_id from google_shopping.",
252
+ "type": "string"
253
+ },
254
+ "url": {
255
+ "description": "A Google Shopping link to the product, instead of product_id.",
256
+ "type": "string"
257
+ }
258
+ },
259
+ "type": "object"
260
+ },
261
+ "name": "google_shopping_product",
262
+ "path": "/v1/shopping/product",
263
+ "title": "Google Shopping product"
264
+ },
265
+ {
266
+ "description": "Searches Google Images and returns about 100 pictures a page, each with the original image's URL, its size, the page it is on and that page's site. Use it when the answer is a picture; for pages about a topic use google_search, for videos google_videos. The filters narrow the same search and can be combined. 2 credits per page, so pages=3 costs 6.",
267
+ "inputSchema": {
268
+ "additionalProperties": false,
269
+ "properties": {
270
+ "aspect": {
271
+ "description": "Only pictures of this shape.",
272
+ "enum": [
273
+ "tall",
274
+ "square",
275
+ "wide",
276
+ "panoramic"
277
+ ],
278
+ "type": "string"
279
+ },
280
+ "color": {
281
+ "description": "color, gray, transparent, or a color: red, orange, yellow, green, teal, blue, purple, pink, white, black, brown.",
282
+ "type": "string"
283
+ },
284
+ "format": {
285
+ "description": "markdown (default, compact for reading) or json (every field).",
286
+ "enum": [
287
+ "markdown",
288
+ "json"
289
+ ],
290
+ "type": "string"
291
+ },
292
+ "gl": {
293
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
294
+ "type": "string"
295
+ },
296
+ "hl": {
297
+ "description": "Interface language, e.g. en, de, ja. Default en.",
298
+ "type": "string"
299
+ },
300
+ "license": {
301
+ "description": "Usage rights, as Google reads them: creative_commons, or commercial for commercial and other licenses.",
302
+ "enum": [
303
+ "creative_commons",
304
+ "commercial"
305
+ ],
306
+ "type": "string"
307
+ },
308
+ "location": {
309
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
310
+ "type": "string"
311
+ },
312
+ "pages": {
313
+ "description": "Pages 1 to N in one call; each page costs its credits.",
314
+ "maximum": 10,
315
+ "minimum": 1,
316
+ "type": "integer"
317
+ },
318
+ "q": {
319
+ "description": "The search query.",
320
+ "type": "string"
321
+ },
322
+ "size": {
323
+ "description": "Only pictures of this size.",
324
+ "enum": [
325
+ "large",
326
+ "medium",
327
+ "icon"
328
+ ],
329
+ "type": "string"
330
+ },
331
+ "type": {
332
+ "description": "Only this kind of picture.",
333
+ "enum": [
334
+ "photo",
335
+ "clipart",
336
+ "lineart",
337
+ "animated",
338
+ "face"
339
+ ],
340
+ "type": "string"
341
+ }
342
+ },
343
+ "required": [
344
+ "q"
345
+ ],
346
+ "type": "object"
347
+ },
348
+ "name": "google_images",
349
+ "path": "/v1/images",
350
+ "title": "Google Images"
351
+ },
352
+ {
353
+ "description": "Searches Google's Videos tab and returns ten videos a page, each with its link, duration, platform (YouTube, TikTok...), channel, date, thumbnail and, for YouTube, the video_id. Use it when the answer is a video, from any platform; for pages use google_search, for pictures google_images. The duration filter keeps short (under 4 minutes), medium (4 to 20) or long videos, and tbs limits the date (qdr:w is the past week). 1 credit per page; failed calls are free.",
354
+ "inputSchema": {
355
+ "additionalProperties": false,
356
+ "properties": {
357
+ "duration": {
358
+ "description": "short (under 4 minutes), medium (4 to 20) or long.",
359
+ "enum": [
360
+ "short",
361
+ "medium",
362
+ "long"
363
+ ],
364
+ "type": "string"
365
+ },
366
+ "format": {
367
+ "description": "markdown (default, compact for reading) or json (every field).",
368
+ "enum": [
369
+ "markdown",
370
+ "json"
371
+ ],
372
+ "type": "string"
373
+ },
374
+ "gl": {
375
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
376
+ "type": "string"
377
+ },
378
+ "hl": {
379
+ "description": "Interface language, e.g. en, de, ja. Default en.",
380
+ "type": "string"
381
+ },
382
+ "location": {
383
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
384
+ "type": "string"
385
+ },
386
+ "pages": {
387
+ "description": "Pages 1 to N in one call; each page costs its credits.",
388
+ "maximum": 10,
389
+ "minimum": 1,
390
+ "type": "integer"
391
+ },
392
+ "q": {
393
+ "description": "The search query.",
394
+ "type": "string"
395
+ },
396
+ "tbs": {
397
+ "description": "Time range: qdr:h, qdr:d, qdr:w, qdr:m or qdr:y, or dates as cdr:1,cd_min:M/D/YYYY,cd_max:M/D/YYYY.",
398
+ "type": "string"
399
+ }
400
+ },
401
+ "required": [
402
+ "q"
403
+ ],
404
+ "type": "object"
405
+ },
406
+ "name": "google_videos",
407
+ "path": "/v1/videos",
408
+ "title": "Google Videos"
409
+ },
410
+ {
411
+ "description": "Searches Google Maps and returns the places it lists, 20 a page, each with type, rating, reviews, price, address, hours, phone, website, coordinates and Google's place ids. Use it to find businesses or places of a kind in an area (coffee shops, dentists, hotels); for web pages about a place use google_search, and for an answer in prose about places, google_ai_mode. Put the kind of place in q and the area in location (Austin,Texas,United States); start=20 is page 2, up to 180. 1 credit per page; failed calls are free.",
412
+ "inputSchema": {
413
+ "additionalProperties": false,
414
+ "properties": {
415
+ "format": {
416
+ "description": "markdown (default, compact for reading) or json (every field).",
417
+ "enum": [
418
+ "markdown",
419
+ "json"
420
+ ],
421
+ "type": "string"
422
+ },
423
+ "gl": {
424
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
425
+ "type": "string"
426
+ },
427
+ "hl": {
428
+ "description": "Interface language, e.g. en, de, ja. Default en.",
429
+ "type": "string"
430
+ },
431
+ "location": {
432
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
433
+ "type": "string"
434
+ },
435
+ "q": {
436
+ "description": "The search query.",
437
+ "type": "string"
438
+ },
439
+ "start": {
440
+ "description": "20 is page 2 on the desktop.",
441
+ "maximum": 180,
442
+ "minimum": 0,
443
+ "type": "integer"
444
+ }
445
+ },
446
+ "required": [
447
+ "q"
448
+ ],
449
+ "type": "object"
450
+ },
451
+ "name": "google_maps",
452
+ "path": "/v1/maps",
453
+ "title": "Google Maps places"
454
+ },
455
+ {
456
+ "description": "Returns Google's search-box suggestions for text as it is typed: a list of suggested queries, with each one's relevance when client is chrome. Use it to see what people search around a phrase or to widen a keyword list. It returns no results or pages; for those, use google_search. 1 credit a call.",
457
+ "inputSchema": {
458
+ "additionalProperties": false,
459
+ "properties": {
460
+ "client": {
461
+ "description": "chrome: 15 with relevance; gws-wiz: the box's 10 with entities.",
462
+ "enum": [
463
+ "chrome",
464
+ "gws-wiz"
465
+ ],
466
+ "type": "string"
467
+ },
468
+ "format": {
469
+ "description": "markdown (default, compact for reading) or json (every field).",
470
+ "enum": [
471
+ "markdown",
472
+ "json"
473
+ ],
474
+ "type": "string"
475
+ },
476
+ "gl": {
477
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
478
+ "type": "string"
479
+ },
480
+ "hl": {
481
+ "description": "Interface language, e.g. en, de, ja. Default en.",
482
+ "type": "string"
483
+ },
484
+ "q": {
485
+ "description": "The text as typed; a trailing space asks what follows.",
486
+ "type": "string"
487
+ }
488
+ },
489
+ "required": [
490
+ "q"
491
+ ],
492
+ "type": "object"
493
+ },
494
+ "name": "google_autocomplete",
495
+ "path": "/v1/autocomplete",
496
+ "title": "Google Autocomplete"
497
+ },
498
+ {
499
+ "description": "Asks Google's AI Mode a question and returns its written answer, with the sources it cites and the places it names (rating, address, phone). Use it for a synthesized answer with citations, or to see which sites Google's AI cites for a question; for the results page itself, links and the AI Overview, use google_search, which is faster and costs 1 credit. location asks from a place, which matters for questions about things nearby; format=json gives the answer in blocks, each with its citations. Takes 5 to 60 seconds. 2 credits an answer; a call that gets no answer is free.",
500
+ "inputSchema": {
501
+ "additionalProperties": false,
502
+ "properties": {
503
+ "format": {
504
+ "description": "markdown (default, compact for reading) or json (every field).",
505
+ "enum": [
506
+ "markdown",
507
+ "json"
508
+ ],
509
+ "type": "string"
510
+ },
511
+ "gl": {
512
+ "description": "Country code of the results, e.g. us, gb, de. Default us.",
513
+ "type": "string"
514
+ },
515
+ "hl": {
516
+ "description": "Interface language, e.g. en, de, ja. Default en.",
517
+ "type": "string"
518
+ },
519
+ "location": {
520
+ "description": "A place by Google's canonical name, down to a ZIP code: Austin,Texas,United States.",
521
+ "type": "string"
522
+ },
523
+ "q": {
524
+ "description": "The question.",
525
+ "type": "string"
526
+ }
527
+ },
528
+ "required": [
529
+ "q"
530
+ ],
531
+ "type": "object"
532
+ },
533
+ "name": "google_ai_mode",
534
+ "path": "/v1/ai-mode",
535
+ "title": "Google AI Mode"
536
+ }
537
+ ];