web-search

Implement web search queries using the z-ai-web-dev-sdk to retrieve structured results with URLs and snippets.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/tmtgroupbot/lptracker-deploy --skill web-search-tmtgroupbot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web-search
Source: https://github.com/tmtgroupbot/lptracker-deploy/tree/main/skills/web-search
Command: npx skills add https://github.com/tmtgroupbot/lptracker-deploy --skill web-search-tmtgroupbot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires z-ai-web-dev-sdk, and includes scripts (resource) components.

What problem does it solve? Applications often need access to real-time information beyond an AI model's knowledge cutoff, such as current news, recent research, or up-to-date facts. This Skill provides the patterns and code to integrate web search into backend applications using the z-ai-web-dev-sdk. ## Core Features & Use Cases - Web Search via SDK or CLI: Invoke the web_search function with a query, result count, and recency filter, either from JavaScript/TypeScript code or the z-ai command line. - Result Processing Patterns: Includes ready-made examples for filtering by domain, sorting by date, caching results, rate limiting, and validating result quality. - Use Case: Build a research assistant that searches for a topic, groups results by domain, sorts them by publication date, and feeds the top snippets into a chat completion for an AI-generated summary with cited sources. ## Quick Start Ask the AI to search the web for the latest news on a topic and return the top five results with titles, URLs, and snippets.

Frequently Asked Questions about web-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add web search to a Node.js application?

Import ZAI from z-ai-web-dev-sdk, create an instance with ZAI.create(), then call zai.functions.invoke with the function name web_search and an arguments object containing your query and desired result count. The response is an array of result items.

How to filter web search results by recency?

Pass a recency_days parameter in the arguments object to limit results to the last N days, for example recency_days: 7 for the past week. You can also sort returned results by their date field in descending order.

Can I use z-ai-web-dev-sdk in client-side browser code?

No, the z-ai-web-dev-sdk must be used in backend code only and never in client-side code. Exposing it in the browser would risk leaking credentials, so wrap searches in a server endpoint such as an Express API route.

What fields does a web search result contain?

Each result is a SearchFunctionResultItem with url, name (page title), snippet (preview text), host_name (domain), rank, date, and favicon. You can map these fields into your own display or storage format.

Why does my web search return empty or no results?

Empty results usually come from overly narrow query terms, connectivity issues, or API problems. Retry with broader keywords, add error handling with exponential backoff, and validate that the response is a non-empty array before processing.