Skip to main content
Glama

extract

Extract specific information from web pages using custom prompts to retrieve targeted data without manual searching.

Instructions

Extracts specific information from a web page based on a prompt. Args: - url: The complete URL of the web page to extract information from - prompt: Instructions specifying what information to extract from the page - enabaleWebSearch: Whether to allow web searches to supplement the extraction - showSources: Whether to include source references in the response

Returns:
- Extracted information from the web page based on the prompt

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
promptYes
enabaleWebSearchYes
showSourcesYes

Implementation Reference

  • main.py:57-77 (handler)
    The primary handler function for the 'extract' MCP tool, registered with @mcp.tool(). It receives input parameters, calls the WebTools.extract_info helper, and handles errors.
    @mcp.tool()
    async def extract(
        url: list[str], prompt: str, enabaleWebSearch: bool, showSources: bool
    ) -> str:
        """Extracts specific information from a web page based on a prompt.
        Args:
        - url: The complete URL of the web page to extract information from
        - prompt: Instructions specifying what information to extract from the page
        - enabaleWebSearch: Whether to allow web searches to supplement the extraction
        - showSources: Whether to include source references in the response
    
        Returns:
        - Extracted information from the web page based on the prompt
        """
        try:
            info_extracted = webtools.extract_info(
                url, enabaleWebSearch, prompt, showSources
            )
            return info_extracted
        except Exception as e:
            return f"Error extracting information: {str(e)}"
  • main.py:58-70 (schema)
    Input schema defined by function parameters and docstring describing args and return type for the 'extract' tool.
    async def extract(
        url: list[str], prompt: str, enabaleWebSearch: bool, showSources: bool
    ) -> str:
        """Extracts specific information from a web page based on a prompt.
        Args:
        - url: The complete URL of the web page to extract information from
        - prompt: Instructions specifying what information to extract from the page
        - enabaleWebSearch: Whether to allow web searches to supplement the extraction
        - showSources: Whether to include source references in the response
    
        Returns:
        - Extracted information from the web page based on the prompt
        """
  • Supporting helper method in WebTools class that implements the core extraction logic by calling FirecrawlApp.extract with configured options.
    def extract_info(
        self, url: list[str], enableWebSearch: bool, prompt: str, showSources: bool
    ):
        try:
            info_extracted = self.firecrawl.extract(
                url,
                {
                    "prompt": prompt,
                    "enableWebSearch": enableWebSearch,
                    "showSources": showSources,
                    "scrapeOptions": {
                        "formats": ["markdown"],
                        "blockAds": True,
                    },
                },
            )
            return info_extracted
        except Exception as e:
            return f"Error extracting information from page {url}: {str(e)}"
  • main.py:57-57 (registration)
    The @mcp.tool() decorator registers the 'extract' function as an MCP tool.
    @mcp.tool()
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 that the tool extracts information and includes parameters for web search and source references, but doesn't describe what happens during extraction (e.g., rate limits, authentication needs, error conditions, or what 'extracted information' looks like). For a tool with 4 parameters and no annotations, this is insufficient behavioral context.

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

Conciseness4/5

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

The description is well-structured with a clear purpose statement followed by parameter explanations and return value description. It's appropriately sized for a 4-parameter tool, though the 'Returns' section could be more specific. Every sentence adds value, and there's no unnecessary repetition or fluff.

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 complexity (4 parameters, no annotations, no output schema), the description is moderately complete. It covers the basic purpose and parameters but lacks details about behavioral traits, error handling, and what the extracted information actually contains. Without an output schema, the return value description is vague ('Extracted information from the web page based on the prompt').

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

Parameters4/5

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

The description provides clear semantic explanations for all 4 parameters beyond what the input schema offers (which has 0% description coverage). It explains that 'url' is for the web page, 'prompt' specifies what to extract, 'enableWebSearch' allows supplemental searches, and 'showSources' includes references. This adds significant value over the bare schema, though it doesn't detail parameter interactions or constraints.

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: extracting specific information from a web page based on a prompt. It specifies the verb ('extracts') and resource ('web page'), but doesn't explicitly differentiate from sibling tools like 'crawl', 'scrape', or 'search' beyond the extraction focus. The description is specific about the action but lacks sibling tool comparison.

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 'crawl', 'scrape', or 'search'. It doesn't mention prerequisites, use cases, or exclusions. The only implied usage is for extracting information from web pages, but with no context about when this is preferable to other tools on the server.

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/josemartinrodriguezmortaloni/webSearch-Tools'

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