Skip to main content
Glama
mikechao

Brave Search MCP

brave_image_search

Search the web for images using the Brave Search API by entering a search term and specifying the number of results, up to three at a time.

Instructions

A tool for searching the web for images using the Brave Search API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoThe number of images to search for, minimum 1, maximum 3
searchTermYesThe term to search the internet for images of

Implementation Reference

  • Core execution logic for the 'brave_image_search' tool: performs image search with BraveSearch API, converts images to base64, stores in internal map, constructs content blocks with text titles and image data, notifies resource changes.
    public async executeCore(input: z.infer<typeof imageSearchInputSchema>) {
      const { searchTerm, count } = input;
      this.server.log(`Searching for images of "${searchTerm}" with count ${count}`, 'debug');
    
      const imageResults = await this.braveSearch.imageSearch(searchTerm, {
        count,
        safesearch: SafeSearchLevel.Strict,
      });
      this.server.log(`Found ${imageResults.results.length} images for "${searchTerm}"`, 'debug');
      const base64Strings = [];
      const titles = [];
      for (const result of imageResults.results) {
        const base64 = await imageToBase64(result.properties.url);
        this.server.log(`Image base64 length: ${base64.length}`, 'debug');
        titles.push(result.title);
        base64Strings.push(base64);
        this.imageByTitle.set(result.title, base64);
      }
      const results = [];
      for (const [index, title] of titles.entries()) {
        results.push({
          type: 'text',
          text: `${title}`,
        });
        results.push({
          type: 'image',
          data: base64Strings[index],
          mimeType: 'image/png',
        });
      }
      this.server.resourceChangedNotification();
      return { content: results };
    }
  • Zod input schema for 'brave_image_search' tool defining parameters: searchTerm (required string) and count (optional number, 1-3, default 1).
    const imageSearchInputSchema = z.object({
      searchTerm: z.string().describe('The term to search the internet for images of'),
      count: z.number().min(1).max(3).optional().default(1).describe('The number of images to search for, minimum 1, maximum 3'),
    });
  • src/server.ts:46-51 (registration)
    Registers the 'brave_image_search' tool with the MCP server by calling server.tool() with the tool's name, description, input schema shape, and bound execute method.
    this.server.tool(
      this.imageSearchTool.name,
      this.imageSearchTool.description,
      this.imageSearchTool.inputSchema.shape,
      this.imageSearchTool.execute.bind(this.imageSearchTool),
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool is for 'searching the web for images using the Brave Search API,' which implies a read-only operation but does not clarify aspects like rate limits, authentication needs, or what happens if no results are found. For a tool with zero annotation coverage, this is insufficient, as it lacks details on behavioral traits beyond the basic purpose.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'A tool for searching the web for images using the Brave Search API.' It is front-loaded with the core purpose, has zero wasted words, and is appropriately sized for the tool's complexity. Every part of the sentence earns its place by specifying the action, resource, and method.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavioral aspects (e.g., rate limits, error handling) and usage guidelines relative to siblings. Without an output schema, it doesn't explain return values, but the schema handles parameters well. This results in a score of 3, indicating it meets the minimum viable threshold but has clear gaps.

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?

The input schema has 100% description coverage, with clear documentation for both parameters ('searchTerm' and 'count'), including defaults and constraints. The description does not add any semantic details beyond what the schema provides (e.g., it doesn't explain parameter interactions or usage examples). According to the rules, when schema_description_coverage is high (>80%), the baseline score is 3, which is appropriate here.

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's purpose: 'searching the web for images using the Brave Search API.' It specifies the verb ('searching'), resource ('images'), and method ('using the Brave Search API'), which is more informative than just restating the name. However, it does not explicitly distinguish this tool from its sibling tools (e.g., brave_web_search, brave_video_search) beyond implying it's for images, which is why it scores 4 instead of 5.

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 its siblings (brave_local_search, brave_news_search, brave_video_search, brave_web_search). It mentions 'searching the web for images,' which implies a general image search context, but offers no explicit when/when-not instructions or alternatives. This lack of comparative guidance results in a score of 2.

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

Related 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/mikechao/brave-search-mcp'

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