Skip to main content
Glama
Decodo

Decodo MCP Server

google_lens

Read-only

Scrape and parse Google Lens image search results by providing an image URL. Get structured data from visual searches.

Instructions

Scrape Google Lens image search results with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesImage URL for Google Lens search (e.g., "https://example.com/image.jpg")
jsRenderNoShould the request be opened in a headless browser, false by default
deviceTypeNoDevice type to emulate for the request

Implementation Reference

  • The GoogleLensTool class extending Tool. Contains the register() method which defines the tool handler, input schema, and invokes the ScraperAPI client with target 'google_lens'. Also includes transformResponse to strip high-character-count fields like 'url_thumbnail'.
    export class GoogleLensTool extends Tool {
      toolset = TOOLSET.SEARCH;
    
      private static FIELDS_WITH_HIGH_CHAR_COUNT = ['url_thumbnail'];
    
      transformResponse = ({ data }: { data: object }) => {
        for (const fieldToRemove of GoogleLensTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
          data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
        }
    
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'google_lens',
          {
            description: 'Scrape Google Lens image search results with automatic parsing',
            inputSchema: {
              query: z.string().describe('Image URL for Google Lens search (e.g., "https://example.com/image.jpg")'),
              jsRender: zodJsRender,
              deviceType: zodDeviceType,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.GOOGLE_LENS,
              parse: true,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            const { data: text } = this.transformResponse({ data });
    
            return {
              content: [
                {
                  type: 'text',
                  text,
                },
              ],
            };
          }
        );
      };
    }
  • The input schema for the 'google_lens' tool: requires a 'query' (image URL string), optional 'jsRender' (boolean), and optional 'deviceType' (enum: desktop/mobile/tablet).
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'google_lens',
        {
          description: 'Scrape Google Lens image search results with automatic parsing',
          inputSchema: {
            query: z.string().describe('Image URL for Google Lens search (e.g., "https://example.com/image.jpg")'),
            jsRender: zodJsRender,
            deviceType: zodDeviceType,
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
  • GoogleLensTool is instantiated in the allTools array in ScraperAPIBaseServer, which is the central registration point for all tools.
    static allTools: Tool[] = [
      new ScrapeAsMarkdownTool(),
      new ScreenshotTool(),
      new GoogleSearchTool(),
      new GoogleAdsTool(),
      new GoogleLensTool(),
      new GoogleAiModeTool(),
      new GoogleTravelHotelsTool(),
      new AmazonSearchTool(),
      new AmazonProductTool(),
      new AmazonPricingTool(),
      new AmazonSellersTool(),
      new AmazonBestsellersTool(),
      new WalmartSearchTool(),
      new WalmartProductTool(),
      new TargetSearchTool(),
      new TargetProductTool(),
      new TiktokPostTool(),
      new TiktokShopSearchTool(),
      new TiktokShopProductTool(),
      new TiktokShopUrlTool(),
      new YoutubeMetadataTool(),
      new YoutubeChannelTool(),
      new YoutubeSubtitlesTool(),
      new YoutubeSearchTool(),
      new RedditPostTool(),
      new RedditSubredditTool(),
      new RedditUserTool(),
      new BingSearchTool(),
      new ChatGPTTool(),
      new PerplexityTool(),
    ];
    
    registerTools({ toolsets }: { toolsets: TOOLSET[] }) {
      if (toolsets.length === 0) {
        this.registerAllTools();
        return;
      }
    
      for (const toolset of toolsets) {
        const tools = ScraperAPIBaseServer.allTools.filter(tool => tool.toolset === toolset);
        for (const tool of tools) {
          tool.register({ server: this.server, sapiClient: this.sapiClient, auth: this.auth });
        }
      }
    }
    
    registerAllTools() {
      for (const tool of ScraperAPIBaseServer.allTools) {
        tool.register({ server: this.server, sapiClient: this.sapiClient, auth: this.auth });
      }
    }
  • Re-exports the google-lens module from the tools barrel index.
    export * from './amazon-search';
    export * from './amazon-product';
    export * from './amazon-pricing';
    export * from './amazon-sellers';
    export * from './amazon-bestsellers';
    export * from './bing-search';
    export * from './chatgpt';
    export * from './google-search';
    export * from './google-ads';
    export * from './google-lens';
  • Helper method transformResponse strips the 'url_thumbnail' field from the API response to reduce character count, then stringifies the result.
    private static FIELDS_WITH_HIGH_CHAR_COUNT = ['url_thumbnail'];
    
    transformResponse = ({ data }: { data: object }) => {
      for (const fieldToRemove of GoogleLensTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
        data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
      }
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint. The description adds 'automatic parsing' but doesn't detail rate limits, failure modes, or result format. Adequate but not enhanced beyond annotations.

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?

Single sentence, no wasted words, front-loaded with key purpose. Perfectly concise for a simple tool.

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?

No output schema and description omits return structure or result details. 'Automatic parsing' is vague. Agent cannot infer what the response looks like, lacking completeness for a scrape tool.

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 coverage is 100%, so parameters are fully described in the schema. The description adds no extra meaning beyond the schema, meeting the baseline.

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

Purpose5/5

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

The description clearly states the action (scrape) and resource (Google Lens image search results) with automatic parsing, distinguishing it from text-based search tools like google_search.

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?

No guidance on when to use this tool versus alternatives (e.g., google_search for text). The description implies image search but lacks explicit context or exclusions.

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

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/Decodo/mcp-server'

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