Skip to main content
Glama
mrgoonie

SearchAPI MCP Server

search_google

Perform Google searches to find web information, returning results with titles, snippets, and links for research or data gathering.

Instructions

Performs a Google search using SearchAPI.site. Requires a search "query" string, can be able to search multiple keywords that separated by commas. Returns formatted search results including titles, snippets, and links.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query to perform
limitNoMaximum number of results to return (1-100)
offsetNoOffset for pagination
sortNoSort order (e.g., "date:d" for newest first)
from_dateNoStart date for filtering results (format: YYYY-MM-DD)
to_dateNoEnd date for filtering results (format: YYYY-MM-DD)

Implementation Reference

  • MCP handler function that executes the search_google tool logic by calling the controller and formatting the response.
    async function handleGoogleSearch(args: GoogleSearchToolArgsType) {
    	const methodLogger = Logger.forContext(
    		'tools/searchapi.tool.ts',
    		'handleGoogleSearch',
    	);
    	methodLogger.debug(`Performing Google search for query: ${args.query}`);
    
    	try {
    		// Map tool arguments to controller options
    		const controllerOptions = {
    			query: args.query,
    		};
    
    		// Call the controller with the mapped options
    		const result =
    			await searchApiController.googleSearch(controllerOptions);
    		methodLogger.debug(`Got the response from the controller`, result);
    
    		// Format the response for the MCP tool
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: result.content,
    				},
    			],
    		};
    	} catch (error) {
    		methodLogger.error(
    			`Error performing Google search for query: ${args.query}`,
    			error,
    		);
    		return formatErrorForMcpTool(error);
    	}
    }
  • Registers the search_google tool with the MCP server, associating name, description, input schema, and handler function.
    	server.tool(
    		'search_google',
    		`Performs a Google search using SearchAPI.site. 
    Requires a search "query" string, can be able to search multiple keywords that separated by commas.
    Returns formatted search results including titles, snippets, and links.
    `,
    		GoogleSearchToolArgs.shape,
    		handleGoogleSearch,
    	);
  • Zod schema defining the input arguments for the search_google tool, including query and optional parameters like limit, offset, etc.
    export const GoogleSearchToolArgs = z.object({
    	query: z.string().describe('The search query to perform'),
    	// apiKey: z.string().optional().describe('Your SearchAPI.site API key'),
    	limit: z
    		.number()
    		.min(1)
    		.max(100)
    		.optional()
    		.describe('Maximum number of results to return (1-100)'),
    	offset: z.number().min(0).optional().describe('Offset for pagination'),
    	sort: z
    		.string()
    		.optional()
    		.describe('Sort order (e.g., "date:d" for newest first)'),
    	from_date: z
    		.string()
    		.optional()
    		.describe('Start date for filtering results (format: YYYY-MM-DD)'),
    	to_date: z
    		.string()
    		.optional()
    		.describe('End date for filtering results (format: YYYY-MM-DD)'),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool 'Returns formatted search results including titles, snippets, and links,' which gives some output context, but lacks critical behavioral details like rate limits, authentication requirements, error handling, pagination behavior (beyond the offset parameter), or whether this is a read-only operation. The mention of 'SearchAPI.site' hints at a third-party service but doesn't explain implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with three sentences, but it's not optimally front-loaded. The first sentence states the purpose, but the second sentence awkwardly mixes parameter guidance ('Requires a search "query" string') with feature description ('can be able to search multiple keywords'). The third sentence covers return values. Some redundancy exists (e.g., 'query' is mentioned twice), and the structure could be tighter for better clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 6 parameters (though well-documented in schema), the description is incomplete. It lacks behavioral context (e.g., rate limits, auth), doesn't explain the relationship with sibling tools, and provides minimal guidance on usage. For a search tool with multiple parameters and no structured output definition, more contextual information would be helpful for an AI agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description adds minimal value beyond the schema: it mentions the query parameter and that it 'can be able to search multiple keywords that separated by commas' (though awkwardly phrased), but doesn't explain other parameters like limit, offset, sort, from_date, or to_date. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'Performs a Google search using SearchAPI.site' with a specific verb ('Performs') and resource ('Google search'), distinguishing it from sibling tools like search_google_images and search_youtube by focusing on general web search. However, it doesn't explicitly contrast with siblings beyond the different search types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like search_google_images or search_youtube. It mentions the tool can search multiple keywords separated by commas, but this is more about parameter usage than contextual guidance. No explicit when/when-not instructions or alternative recommendations are included.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrgoonie/searchapi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server