Skip to main content
Glama
code-alchemist01

Development Tools MCP Server

extract_after_click

Extract content from web pages by first clicking an element to reveal dynamic content, then scraping specified elements for development workflows.

Instructions

Click an element and extract content from another element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to scrape
clickSelectorYesCSS selector of element to click
extractSelectorYesCSS selector of element to extract

Implementation Reference

  • Core handler implementation: Navigates to the URL using Playwright, clicks the specified element, waits for the target element to appear, extracts its text content, and returns it.
    async extractAfterClick(config: ScrapingConfig, clickSelector: string, extractSelector: string): Promise<string> {
      const browser = await this.getBrowser();
      const page = await browser.newPage();
    
      try {
        await page.goto(config.url, {
          waitUntil: 'networkidle',
          timeout: config.timeout || 30000,
        });
    
        await page.click(clickSelector);
        await page.waitForTimeout(1000);
    
        await page.waitForSelector(extractSelector, {
          timeout: config.waitForTimeout || 10000,
        });
    
        const text = await page.textContent(extractSelector);
        return text || '';
      } finally {
        await page.close();
      }
    }
  • Dispatcher handler case: Parses input parameters and calls the DynamicScraper.extractAfterClick method.
    case 'extract_after_click': {
      const clickSelector = params.clickSelector as string;
      const extractSelector = params.extractSelector as string;
      const content = await dynamicScraper.extractAfterClick(config, clickSelector, extractSelector);
      return { content };
    }
  • Input schema defining the parameters: url, clickSelector, and extractSelector.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'URL to scrape',
        },
        clickSelector: {
          type: 'string',
          description: 'CSS selector of element to click',
        },
        extractSelector: {
          type: 'string',
          description: 'CSS selector of element to extract',
        },
      },
      required: ['url', 'clickSelector', 'extractSelector'],
    },
  • Tool registration in the webScrapingTools array, including name, description, and input schema.
    {
      name: 'extract_after_click',
      description: 'Click an element and extract content from another element',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'URL to scrape',
          },
          clickSelector: {
            type: 'string',
            description: 'CSS selector of element to click',
          },
          extractSelector: {
            type: 'string',
            description: 'CSS selector of element to extract',
          },
        },
        required: ['url', 'clickSelector', 'extractSelector'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions clicking and extracting, implying interaction and data retrieval, but fails to detail critical aspects like error handling (e.g., what happens if selectors aren't found), performance (e.g., timeouts or delays), or output format (e.g., text or structured data). This leaves significant gaps for safe and effective use.

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 extremely concise and front-loaded, consisting of a single, direct sentence that captures the core functionality without any wasted words. Every part of the sentence earns its place by clearly stating the tool's actions and targets.

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 the complexity of a web interaction tool with no annotations and no output schema, the description is insufficiently complete. It lacks details on behavioral traits (e.g., what 'extract' entails in terms of output), error conditions, or usage context, making it hard for an agent to use this tool reliably without additional information.

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, clearly documenting all three parameters (url, clickSelector, extractSelector) with their purposes. The description adds no additional meaning beyond this, such as examples or constraints, so it meets the baseline score of 3 for adequate but not enhanced parameter semantics.

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 with specific verbs ('click' and 'extract') and resources ('element' and 'content'), making it easy to understand what it does. However, it doesn't distinguish itself from sibling tools like 'scrape_with_interaction' or 'scrape_dynamic_content', which may have overlapping functionality, so it doesn't reach the highest score.

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. It doesn't mention prerequisites, such as requiring a dynamic webpage, or compare it to siblings like 'scrape_by_selector' or 'scrape_with_interaction', leaving the agent to guess based on context alone.

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/code-alchemist01/development-tools-mcp-Server'

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