web-search
Implement web search capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to search the web, retrieve current information, find relevant content, or build applications with real-time web search functionality. Returns structured search results with URLs, snippets, and metadata.
What this skill does
# Web Search Skill
This skill guides the implementation of web search functionality using the z-ai-web-dev-sdk package, enabling applications to search the web and retrieve current information.
## Installation Path
**Recommended Location**: `{project_path}/skills/web-search`
Extract this skill package to the above path in your project.
**Reference Scripts**: Example test scripts are available in the `{project_path}/skills/web-search/scripts/` directory for quick testing and reference. See `{project_path}/skills/web-search/scripts/web_search.ts` for a working example.
## Overview
The Web Search skill allows you to build applications that can search the internet, retrieve current information, and access real-time data from web sources.
**IMPORTANT**: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.
## Prerequisites
The z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.
## CLI Usage (For Simple Tasks)
For simple web search queries, you can use the z-ai CLI instead of writing code. This is ideal for quick information retrieval, testing search functionality, or command-line automation.
### Basic Web Search
```bash
# Simple search query
z-ai function --name "web_search" --args '{"query": "artificial intelligence"}'
# Using short options
z-ai function -n web_search -a '{"query": "latest tech news"}'
```
### Search with Custom Parameters
```bash
# Limit number of results
z-ai function \
-n web_search \
-a '{"query": "machine learning", "num": 5}'
# Search with recency filter (results from last N days)
z-ai function \
-n web_search \
-a '{"query": "cryptocurrency news", "num": 10, "recency_days": 7}'
```
### Save Search Results
```bash
# Save results to JSON file
z-ai function \
-n web_search \
-a '{"query": "climate change research", "num": 5}' \
-o search_results.json
# Recent news with file output
z-ai function \
-n web_search \
-a '{"query": "AI breakthroughs", "num": 3, "recency_days": 1}' \
-o ai_news.json
```
### Advanced Search Examples
```bash
# Search for specific topics
z-ai function \
-n web_search \
-a '{"query": "quantum computing applications", "num": 8}' \
-o quantum.json
# Find recent scientific papers
z-ai function \
-n web_search \
-a '{"query": "genomics research", "num": 5, "recency_days": 30}' \
-o genomics.json
# Technology news from last 24 hours
z-ai function \
-n web_search \
-a '{"query": "tech industry updates", "recency_days": 1}' \
-o today_tech.json
```
### CLI Parameters
- `--name, -n`: **Required** - Function name (use "web_search")
- `--args, -a`: **Required** - JSON arguments object with:
- `query` (string, required): Search keywords
- `num` (number, optional): Number of results (default: 10)
- `recency_days` (number, optional): Filter results from last N days
- `--output, -o <path>`: Optional - Output file path (JSON format)
### Search Result Structure
Each result contains:
- `url`: Full URL of the result
- `name`: Title of the page
- `snippet`: Preview text/description
- `host_name`: Domain name
- `rank`: Result ranking
- `date`: Publication/update date
- `favicon`: Favicon URL
### When to Use CLI vs SDK
**Use CLI for:**
- Quick information lookups
- Testing search queries
- Simple automation scripts
- One-off research tasks
**Use SDK for:**
- Dynamic search in applications
- Multi-step search workflows
- Custom result processing and filtering
- Production applications with complex logic
## Search Result Type
Each search result is a `SearchFunctionResultItem` with the following structure:
```typescript
interface SearchFunctionResultItem {
url: string; // Full URL of the result
name: string; // Title of the page
snippet: string; // Preview text/description
host_name: string; // Domain name
rank: number; // Result ranking
date: string; // Publication/update date
favicon: string; // Favicon URL
}
```
## Basic Web Search
### Simple Search Query
```javascript
import ZAI from 'z-ai-web-dev-sdk';
async function searchWeb(query) {
const zai = await ZAI.create();
const results = await zai.functions.invoke('web_search', {
query: query,
num: 10
});
return results;
}
// Usage
const searchResults = await searchWeb('What is the capital of France?');
console.log('Search Results:', searchResults);
```
### Search with Custom Result Count
```javascript
import ZAI from 'z-ai-web-dev-sdk';
async function searchWithLimit(query, numberOfResults) {
const zai = await ZAI.create();
const results = await zai.functions.invoke('web_search', {
query: query,
num: numberOfResults
});
return results;
}
// Usage - Get top 5 results
const topResults = await searchWithLimit('artificial intelligence news', 5);
// Usage - Get top 20 results
const moreResults = await searchWithLimit('JavaScript frameworks', 20);
```
### Formatted Search Results
```javascript
import ZAI from 'z-ai-web-dev-sdk';
async function getFormattedResults(query) {
const zai = await ZAI.create();
const results = await zai.functions.invoke('web_search', {
query: query,
num: 10
});
// Format results for display
const formatted = results.map((item, index) => ({
position: index + 1,
title: item.name,
url: item.url,
description: item.snippet,
domain: item.host_name,
publishDate: item.date
}));
return formatted;
}
// Usage
const results = await getFormattedResults('climate change solutions');
results.forEach(result => {
console.log(`${result.position}. ${result.title}`);
console.log(` ${result.url}`);
console.log(` ${result.description}`);
console.log('');
});
```
## Advanced Use Cases
### Search with Result Processing
```javascript
import ZAI from 'z-ai-web-dev-sdk';
class SearchProcessor {
constructor() {
this.zai = null;
}
async initialize() {
this.zai = await ZAI.create();
}
async search(query, options = {}) {
const {
num = 10,
filterDomain = null,
minSnippetLength = 0
} = options;
const results = await this.zai.functions.invoke('web_search', {
query: query,
num: num
});
// Filter results
let filtered = results;
if (filterDomain) {
filtered = filtered.filter(item =>
item.host_name.includes(filterDomain)
);
}
if (minSnippetLength > 0) {
filtered = filtered.filter(item =>
item.snippet.length >= minSnippetLength
);
}
return filtered;
}
extractDomains(results) {
return [...new Set(results.map(item => item.host_name))];
}
groupByDomain(results) {
const grouped = {};
results.forEach(item => {
if (!grouped[item.host_name]) {
grouped[item.host_name] = [];
}
grouped[item.host_name].push(item);
});
return grouped;
}
sortByDate(results, ascending = false) {
return results.sort((a, b) => {
const dateA = new Date(a.date);
const dateB = new Date(b.date);
return ascending ? dateA - dateB : dateB - dateA;
});
}
}
// Usage
const processor = new SearchProcessor();
await processor.initialize();
const results = await processor.search('machine learning tutorials', {
num: 15,
minSnippetLength: 50
});
console.log('Domains found:', processor.extractDomains(results));
console.log('Grouped by domain:', processor.groupByDomain(results));
console.log('Sorted by date:', processor.sortByDate(results));
```
### News Search
```javascript
import ZAI from 'z-ai-web-dev-sdk';
async function searchNews(topic, timeframe = 'recent') {
const zai = await ZAI.create();
// Add time-based keywords to query
const timeKeywords = {
recent: 'latest news',
today: 'today news',
week: 'this week news',
month: 'this month news'
};
const query = `${topic} ${timeKeywords[timeframe] || timeKeywords.recent}`;
const results = await zai.functions.inRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.