Repository navigation
Source AgentCore Web Search Tool
A fully managed, MCP-compliant web search tool attached to an AgentCore Gateway.
Read on 2026-09-29. Recorded because it is a direct alternative to the
hand-rolled packages/agent/src/tools/webSearchTool.ts.
Attached to a Gateway with connectorId: "web-search". Agents then discover it
through MCP tools/list and call it through tools/call — no bespoke client
code, because the agent already speaks MCP.
Input schema:
| Field | Constraint |
|---|---|
query |
Required, ≤ 200 characters |
maxResults |
1–25, default 10 |
filters.domainFilter |
Include or exclude, ≤ 100 domains each (connector 1.2.0+) |
filters.publishedDateFilter |
ISO-8601 from / to (connector 1.2.0+) |
Backed by an Amazon-operated index of tens of billions of documents plus a knowledge graph, and it performs semantic snippet extraction rather than returning raw result blobs.
Our current tool calls Google Custom Search with SEARCH_API_KEY and
SEARCH_ENGINE_ID. Comparing the two:
| Current (Google CSE) | AgentCore Web Search | |
|---|---|---|
| Egress | Third-party | Queries never leave AWS |
| Credentials | Two secrets we hold and rotate | IAM, via the Gateway |
| Integration | Hand-written tool | MCP discovery |
| Cost | 100/day free, then $5 / 1,000 (existing customers only) | First 5,000 / month free, then $7.00 / 1,000 |
| Result quality | Raw CSE results | Semantic snippet extraction |
The first two rows are the constitution P11 argument: fewer third-party dependencies, fewer long-lived secrets in our custody.
Until 2026-11-16 this page called the cost row a strong counter-argument ("1,000 searches would consume 70% of the entire budget"). That was the list price without the free allowance and is corrected below: the first 5,000 queries each month are free.
The Gateway is no longer the only route. AWS now exposes the same index as the
InvokeWebSearch operation on the bedrock-agentcore data plane: one
SigV4-signed call from the AWS SDKs, authorised by IAM alone, with no gateway,
target or other resource to create (AWS blog,
AgentCore guide).
| IAM |
bedrock-agentcore:InvokeWebSearch on arn:aws:bedrock-agentcore:<Region>:aws:tool/web-search.v1; the account field is the literal aws
|
| Request |
webSearchId: 'web-search.v1', searchQuery ≤ 200 characters, maxResults 1–25 (default 25), filters.domainFilter, filters.publishedDateFilter
|
| Result |
text extract, plus title, url and publishedAt when indexed |
| Regions | us-east-1, us-east-2, us-west-2, ap-southeast-2, ap-northeast-1, eu-west-1 |
| Quota | 10 requests per second per Region by default |
| Price | First 5,000 queries per month free per AWS account (shared across Regions and between the API and the Gateway connector), then $7.00 / 1,000 (release notes, pricing) |
We already carry the client. @aws-sdk/client-bedrock-agentcore 3.1169.0 is
installed in packages/agent (the package depends on ^3.1167.0) and has an
InvokeWebSearch command, so adoption needs no new dependency and no secret:
the two SSM parameters SSM_PARAM_SEARCH_API_KEY and SSM_PARAM_SEARCH_ENGINE_ID
went away when it was adopted (2026-11-16).
Acceptable use binds the output: show the source citations and links the API returns with each result in anything an end user sees, and do not extract, store or reproduce results in bulk or build a competing index. A persona that speaks results aloud needs a decision on how it cites.
At the free allowance the cost is $0. Beyond it, each further 1,000 queries is
70% of Concept-Budget-Ceiling's $10/month. TURN_MAX_TOOL_EXECUTIONS
bounds tool calls per turn; a per-session search cap has not been decided.
Google's Custom Search JSON API overview, read 2026-10-11, says the API is discontinued on January 1, 2027 and is not available for new customers. That changes the comparison above:
- The free tier is not an option that lasts.
webSearchTool.ts:40calls the API directly, so the tool stops working within months of a first deployment. - A builder without an existing key cannot get one at all, so whether the first deployment has web search depends on whether a key already exists.
Spec 003 left the replacement out of scope. The builder adopted
InvokeWebSearch on 2026-11-16 (spec 003 C46); see
Decision-Web-Search-Provider and Source-Spec-003.
Vendor pages were read directly unless marked unverified.
| Option | Price | Credential | Note |
|---|---|---|---|
AgentCore InvokeWebSearch |
5,000/month free, then $7 / 1,000 | none (IAM) | Leading candidate: no new dependency, no secret, queries stay in AWS |
| AgentCore Gateway connector | same | none, plus a gateway and an MCP client | Same index with more moving parts; worth it only to share one policy across agents |
| Brave Search API | $5 / 1,000; $5 free credit a month (about 1,000 queries); card required | one key | Own index, no Google or Bing fallback. Storing results needs a custom plan. The page banner says "up to $20", the plan card says $5; unreconciled |
| Exa | Search from $4 / 1,000; $10 free credit a month (2,500 Lite searches), no card | one key | Neural search; behaviour on news and fact queries untested |
| Tavily | 1,000 credits free a month, no card; $0.008 / credit after | one key | Built for agent grounding |
| Serper, SerpApi | per vendor | one key | Avoid. They scrape Google. Brave's page says this violates Google's terms (a competitor's claim); Google's DMCA suit against SerpApi is reported only by secondary sources and is unverified |
| Vertex AI Search | per Google | Google Cloud | Site search over at most 50 domains, not whole-web, and a new cloud |
| Bing Search APIs | n/a | n/a | Retired, per Brave's page (unverified by us) |
| Google CSE JSON API | 100/day free | key and engine ID | Closed to new customers; ends 2027-01-01 |
Adopted on 2026-11-16 for the web_search tool; see
Decision-Web-Search-Provider. What is still open:
- Quality is untested. A live call is a billable probe (free inside the 5,000, but still needs approval) and has not been made (spec 003 T180).
- Free-plan eligibility is unconfirmed. AWS says the free queries apply to "every AWS account"; whether that includes Free-plan accounts is not stated.
- Citation display versus the persona's voice (acceptable use, above; T181).
- A per-session search cap and metering, since beyond the free allowance each query costs real budget and the breaker does not price searches yet. See Concept-Budget-Ceiling and T181.
The swap removed the search half of the runtime's hard start-up dependency on
SSM parameters: only the weather and news parameters remain (T178b). The two
SSM_PARAM_SEARCH_* parameters are no longer read.
See also: Component-Agent-Runtime, Source-AgentCore-Pricing, Index.
- Concept-Cloud-Only-Inference
- Concept-Budget-Ceiling
- Concept-Personality-Gate
- Concept-IP-And-Legal-Posture
- Concept-Supply-Chain-Discipline
- Concept-Graceful-Degradation
- Concept-Observability
- Concept-Testing-And-TDD
- Concept-Credential-Hygiene
Editing in the browser? Wiki edits are live and bypass wiki:lint. Read
Guide-Wiki-Contributing first.