Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计提醒

xai-agent-toolsxaiAgent 工具

Agent Skill

xai-agent-tools 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

451

周安装

19

GitHub Stars

9

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:xai-agent-tools(xaiAgent 工具)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/xai-agent-tools
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill xai-agent-tools
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill xai-agent-tools

简介

xai-agent-tools 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 它主要面向研究者和分析师快速获取相关数据和信息。
  • 适用于需要信息聚合和智能筛选的任务场景。

SKILL.md

xAI Agent Tools API

Server-side agentic tool calling that enables Grok to autonomously search, analyze, and execute code.

Overview

The Agent Tools API manages the entire reasoning and tool-execution loop on the server side, unlike traditional tool-calling where clients must handle each invocation.

Available Tools:

  • x_search - Search Twitter/X posts
  • web_search - Real-time web search
  • code_execution - Python sandbox
  • document_search - Search uploaded documents

Quick Start

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("XAI_API_KEY"),
    base_url="https://api.x.ai/v1"
)

# Agent with automatic tool use
response = client.chat.completions.create(
    model="grok-4-1-fast",
    messages=[{
        "role": "user",
        "content": "Search X for Tesla news, then search the web for Tesla stock price, and calculate the sentiment score"
    }]
)
print(response.choices[0].message.content)

Tool Configurations

X Search Tool

x_search_config = {
    "type": "x_search",
    "x_search": {
        "enabled": True,
        "allowed_x_handles": ["elonmusk", "Tesla"],  # Max 10
        "excluded_x_handles": [],  # Cannot use with allowed
        "date_range": {
            "start": "2025-12-01",  # ISO8601
            "end": "2025-12-05"
        },
        "include_media": True  # Analyze images/videos
    }
}

Web Search Tool

web_search_config = {
    "type": "web_search",
    "web_search": {
        "enabled": True,
        "search_depth": "comprehensive",  # or "quick"
        "include_domains": ["reuters.com", "bloomberg.com"],
        "exclude_domains": ["spam.com"]
    }
}

Code Execution Tool

code_execution_config = {
    "type": "code_execution",
    "code_execution": {
        "enabled": True,
        "language": "python",
        "timeout": 30  # seconds
    }
}

Agent Patterns

Research Agent

def research_agent(query: str) -> str:
    """Agent that searches both X and web for comprehensive research."""
    response = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{
            "role": "user",
            "content": f"""You are a research agent. For the query: "{query}"

            1. Search X for real-time social discussion
            2. Search the web for news and analysis
            3. Synthesize findings into a comprehensive report

            Include:
            - Key findings from X
            - Key findings from web
            - Sentiment analysis
            - Recommendations"""
        }]
    )
    return response.choices[0].message.content

Analysis Agent

def analysis_agent(data: str, analysis_type: str) -> str:
    """Agent that uses code execution for analysis."""
    response = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{
            "role": "user",
            "content": f"""Analyze this data using Python:

            Data: {data}
            Analysis type: {analysis_type}

            Use code execution to:
            1. Parse the data
            2. Perform statistical analysis
            3. Generate insights
            4. Create visualizations if helpful

            Return the analysis results."""
        }]
    )
    return response.choices[0].message.content

Financial Agent

def financial_agent(ticker: str) -> str:
    """Comprehensive financial analysis agent."""
    response = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{
            "role": "user",
            "content": f"""You are a financial analyst agent. Analyze ${ticker}:

            1. Search X for:
               - Retail sentiment
               - Influencer opinions
               - Breaking news

            2. Search web for:
               - Recent news articles
               - Analyst ratings
               - Earnings reports

            3. Use code execution to:
               - Calculate sentiment score
               - Analyze mention velocity
               - Generate summary statistics

            Return a comprehensive investment report with:
            - Overall sentiment
            - Key catalysts
            - Risk factors
            - Trading recommendation"""
        }]
    )
    return response.choices[0].message.content

Multi-Step Agent

def multi_step_agent(objective: str) -> str:
    """Agent that breaks down and executes complex tasks."""
    response = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{
            "role": "user",
            "content": f"""Objective: {objective}

            You have access to:
            - X search (real-time social data)
            - Web search (news and information)
            - Code execution (Python analysis)

            Process:
            1. Break down the objective into steps
            2. Execute each step using appropriate tools
            3. Synthesize results
            4. Provide actionable insights

            Think step by step and use tools as needed."""
        }]
    )
    return response.choices[0].message.content

Tool Cost Management

ToolCost per 1,000 calls
X Search$5.00
Web Search$5.00
Code Execution$5.00
Document Search$2.50

Cost-Optimized Agent

def cost_optimized_agent(query: str, max_tool_calls: int = 3) -> str:
    """Agent with tool call limits for cost control."""
    response = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{
            "role": "user",
            "content": f"""Query: {query}

            IMPORTANT: Minimize tool usage. You have a budget of {max_tool_calls} tool calls.
            - Only use tools when essential
            - Combine related searches
            - Prefer single comprehensive searches

            Provide the best answer within this constraint."""
        }]
    )
    return response.choices[0].message.content

Error Handling

def robust_agent(query: str) -> dict:
    """Agent with comprehensive error handling."""
    try:
        response = client.chat.completions.create(
            model="grok-4-1-fast",
            messages=[{"role": "user", "content": query}],
            timeout=60
        )

        return {
            "success": True,
            "result": response.choices[0].message.content,
            "usage": {
                "prompt_tokens": response.usage.prompt_tokens,
                "completion_tokens": response.usage.completion_tokens
            }
        }

    except Exception as e:
        return {
            "success": False,
            "error": str(e),
            "error_type": type(e).__name__
        }

Streaming Responses

def streaming_agent(query: str):
    """Agent with streaming output."""
    stream = client.chat.completions.create(
        model="grok-4-1-fast",
        messages=[{"role": "user", "content": query}],
        stream=True
    )

    for chunk in stream:
        if chunk.choices[0].delta.content:
            print(chunk.choices[0].delta.content, end="", flush=True)

Conversation Context

class ConversationalAgent:
    """Agent that maintains conversation history."""

    def __init__(self):
        self.messages = []

    def add_system_prompt(self, prompt: str):
        self.messages.append({"role": "system", "content": prompt})

    def chat(self, user_message: str) -> str:
        self.messages.append({"role": "user", "content": user_message})

        response = client.chat.completions.create(
            model="grok-4-1-fast",
            messages=self.messages
        )

        assistant_message = response.choices[0].message.content
        self.messages.append({"role": "assistant", "content": assistant_message})

        return assistant_message

# Usage
agent = ConversationalAgent()
agent.add_system_prompt("You are a financial analyst with access to X and web search.")
print(agent.chat("What's the sentiment on AAPL?"))
print(agent.chat("Compare that to MSFT"))

Best Practices

  1. Use grok-4-1-fast - Optimized for tool calling
  2. Be specific - Clear instructions reduce unnecessary tool calls
  3. Set limits - Control costs with tool call budgets
  4. Handle errors - Tools can fail, plan for it
  5. Stream for UX - Use streaming for long responses
  6. Cache results - Don't repeat identical searches

Model Selection for Agents

ModelTool CallingSpeedCost
grok-4-1-fast⭐⭐⭐⭐⭐⭐⭐⭐⭐
grok-4⭐⭐
grok-3-fast⭐⭐⭐⭐⭐⭐

Related Skills

  • xai-x-search - X search details
  • xai-sentiment - Sentiment analysis
  • xai-stock-sentiment - Stock analysis

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.06%
按下载量换算44

github-copilot

22.72%
按下载量换算36

OpenCode

16.76%
按下载量换算26

neovate

11.21%
按下载量换算18

Antigravity

7%
按下载量换算11

kilo

3.27%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills