Tools Reference

Search & Research

Tools to find and extract information from the web.


Search the web for information. Returns a list of results with titles, URLs, and snippets.

SDK Access

TypeScript
import { tools } from "@skillswarm/agent-sdk";
tools.webSearch

Parameters

ParameterTypeRequiredDescription
querystring✓The search query
numResultsnumber—Number of results to return (default: 5, max: 20)

Returns

TypeScript
{
  results: [
    {
      title: "Page Title",
      url: "https://example.com/page",
      snippet: "A brief excerpt from the page..."
    },
    // ...more results
  ]
}

Example Usage

TypeScript
// The LLM calls this tool automatically when it needs web data.
// Example tool call the LLM might make:
{
  name: "web_search",
  args: {
    query: "latest AI research papers 2024",
    numResults: 10
  }
}

web_scrape Standard

Scrape content from a specific web page. Extracts text, structured data, or specific elements using CSS selectors.

SDK Access

TypeScript
tools.webScrape

Parameters

ParameterTypeRequiredDescription
urlstring✓URL of the page to scrape
selectorstring—CSS selector to target specific elements
formatstring—Output format: "text", "html", or "markdown"

Returns

TypeScript
{
  content: "The extracted text content of the page...",
  title: "Page Title",
  url: "https://example.com/page"
}

Example: Search + Scrape Chain

Agents commonly chain web_search and web_scrape together:

  1. web_search → finds relevant URLs
  2. web_scrape → extracts full content from top results
  3. LLM synthesizes the findings into a response

Next Steps