Skip to main content
Glama

AgentSearch Web Search

agentsearch_web_search
Read-onlyIdempotent

Search the web for a query and return up to five ranked hits as pretty-printed JSON. Use it when you need links and snippets instead of page text.

Instructions

Search the web with AgentSearch and return the response as pretty-printed JSON text. Use this when you have a query and need hits rather than a page body; if you already have a URL, use agentsearch_extract instead (or agentsearch_render for JavaScript-heavy pages). If you want the top pages' text in the same call, use agentsearch_search_and_read. Free by default: with no configuration it uses the AgentSearch free tier (25 free searches per IP in total, then pay per call, subject to shared daily capacity, no payment), even if a wallet key is set for Extract/Render. Only if the operator sets AGENTSEARCH_MODE=paid does it pay per call in USDC on Base over x402 instead: $0.003 to AgentSearch's own x402 API by default, or $0.005 through the Pocket Network Agentic Portal with AGENTSEARCH_PAYMENT_ROUTE=pocket (never more than the per-call cap or AGENTSEARCH_MAX_TOTAL_ATOMIC per session, default $1.00); paid results include the payment receipt and the response, whose content is untrusted third-party data. If AGENTSEARCH_BASE_URL is set, it calls your self-hosted AgentSearch API instead (no payment). Read-only: not destructive, but it uses the network and can hit rate limits (on the free tier, a 429 means the 25 free searches per IP in total are used up or shared daily capacity is reached; the error says how to upgrade). Integers for max_results outside 1–5 are clamped (default 5), not rejected. Filters (freshness or date_from/date_to, country, language, include_domains, exclude_domains) apply on the paid direct route (AGENTSEARCH_MODE=paid); the free tier ignores them. For recent news articles use agentsearch_news_search.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "agentsearch_web_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesKeywords or a natural-language question to search for (at least 2 characters).
countryNo2-letter ISO 3166-1 country code to localise results, e.g. us, gb, de.
date_toNoLatest publish date, YYYY-MM-DD.
languageNoISO 639-1 language, e.g. en, es or pt-BR.
date_fromNoEarliest publish date, YYYY-MM-DD.
freshnessNoOnly results from the past day, week, month or year. Do not combine with date_from/date_to.
max_resultsNoHow many hits to request (1–5, default 5). Values outside that range are clamped.
exclude_domainsNoNever return results from these domains, up to 5.
include_domainsNoOnly return results from these domains (subdomains included), up to 5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.8.1
    • changedInput schema / properties / query / description
      Previous value: -"Keywords or a natural-language question to search for."New value: +"Keywords or a natural-language question to search for (at least 2 characters)."
    • changedInput schema / properties / query / minLength
      Previous value: -1New value: +2
  2. Changed7 schema fields changedv1.8.0
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "2-letter ISO 3166-1 country code to localise results, e.g. us, gb, de.",
      +  "maxLength": 2,
      +  "minLength": 2,
      +  "type": "string"
      +}
    • addedInput schema / properties / date_from
      Added value: +{
      +  "description": "Earliest publish date, YYYY-MM-DD.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / date_to
      Added value: +{
      +  "description": "Latest publish date, YYYY-MM-DD.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / exclude_domains
      Added value: +{
      +  "description": "Never return results from these domains, up to 5.",
      +  "items": {
      +    "maxLength": 253,
      +    "type": "string"
      +  },
      +  "maxItems": 5,
      +  "type": "array"
      +}
    • addedInput schema / properties / freshness
      Added value: +{
      +  "description": "Only results from the past day, week, month or year. Do not combine with date_from/date_to.",
      +  "enum": [
      +    "day",
      +    "week",
      +    "month",
      +    "year"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / include_domains
      Added value: +{
      +  "description": "Only return results from these domains (subdomains included), up to 5.",
      +  "items": {
      +    "maxLength": 253,
      +    "type": "string"
      +  },
      +  "maxItems": 5,
      +  "type": "array"
      +}
    • addedInput schema / properties / language
      Added value: +{
      +  "description": "ISO 639-1 language, e.g. en, es or pt-BR.",
      +  "pattern": "^[A-Za-z]{2}(-[A-Za-z]{2})?$",
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv1.3.6
    • changedInput schema / properties / max_results / description
      Previous value: -"Max results to return (1–10, default 5)"New value: +"How many hits to request (1–5, default 5). Values outside that range are clamped."
    • changedInput schema / properties / query / description
      Previous value: -"Search query string"New value: +"Keywords or a natural-language question to search for."
  4. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover readOnly/openWorld/idempotent/non-destructive, and the description still adds substantial non-structured context: free-tier quota of 25 searches per IP, the meaning of a 429, shared daily capacity, x402/Base USDC pricing under AGENTSEARCH_MODE=paid, per-call and per-session caps, self-hosted base URL behaviour, and the warning that result content is untrusted third-party data. The only shortfall is that the shape of a 'hit' is never characterised, so an agent cannot anticipate fields without calling.

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

Conciseness3/5

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

The front-loading is good, with purpose and routing in the first two sentences, but the middle section becomes a dense operator-configuration dump covering env vars, three pricing tiers and two spending caps that most calling agents cannot act on. It also restates max_results clamping, which the schema already documents, and circles back to the free-tier limit twice (quota in one sentence, 429 meaning later).

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

Completeness4/5

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

With no output schema, the description does carry return-value burden and it partly discharges it (JSON text, paid mode includes a payment receipt alongside the response). It is thorough on cost, quota and failure modes, which are the real hazards of this tool, but omits result structure, so it stops slightly short of fully complete.

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?

Schema coverage is 100%, so a baseline of 3 applies, but the description adds genuine meaning the schema cannot express: the filter parameters (freshness, date_from/date_to, country, language, include_domains, exclude_domains) are silently ignored on the free tier and only take effect on the paid direct route. That is a material behavioural caveat about parameter effect, not a restatement of the schema.

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 first sentence names a specific verb (search) and resource (the web via AgentSearch) and states the return form (pretty-printed JSON). The following sentences explicitly separate it from agentsearch_extract, agentsearch_render, agentsearch_search_and_read and agentsearch_news_search, so an agent can route without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a positive selection rule ('when you have a query and need hits rather than a page body') plus explicit exclusions with the alternative named for each case (already have a URL → extract; JS-heavy → render; want page text in the same call → search_and_read; news → news_search). This is the full when/when-not/alternative triad.

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