Skill Overview
This skill automates the full workflow of tool discovery and execution, backed by Agent Earth. The base address is https://agentearth.ai:
CODEBLOCK0
Core value:
- - Active discovery: You don’t need to remember tool inventory; just describe your intent.
- Context awareness: Understand implicit parameters across turns (e.g., “prices there”).
- Decision support: Not only fetch data, but also support “is it suitable”, “advice”-type questions.
Authentication
All requests to https://agentearth.ai (including recommend and execute) must include the header:
- - Header Name: INLINECODE2
- Header Value: INLINECODE3
- Note: The value comes from environment variable
$AGENT_EARTH_API_KEY. - Get Key: Visit the official site at https://agentearth.ai/ and generate an API Key in your profile.
When To Use
Use this skill when the user expresses any of the following intents:
- - Current affairs news: “I want to know the latest situation in Iran…”
- Decision consultation: “Is it suitable to ski in Hokkaido these days?” (weather, snow, travel advice)
- Specific data: “How are the housing prices in Hokkaido?” (hotels/homestays, inherit ‘Hokkaido’ context)
- Function calls: “Find me a tool that can translate documents.”
- Any scenario implying external information is needed
Workflow
Step 1: Call Recommend API
Send JSON to INLINECODE5
Headers:
Body:
CODEBLOCK1
Context Injection:
If the user’s request depends on context (e.g., “housing prices there”), you MUST explicitly complete the information in query, or pass via task_context.
- - User input: “How are the housing prices there?”
- History: “I want to go skiing in Hokkaido”
- Final Query: “Housing prices for Hokkaido ski resorts”
Step 2: Selection
Analyze the recommend results (tools list), prioritize:
- 1. Direct match: the tool description closely matches the task.
- Combined capability: for multi-step tasks (e.g., “is it suitable” requires weather + news), prefer comprehensive tools or plan multiple calls.
Step 2.5: Parameter Validation
Before calling execute, validate against the selected tool’s input_schema:
- 1. Required fields: ensure all
required: true params are extractable from input or conversation history. - Missing handling:
- If required params are missing, do NOT call execute.
- Ask the user for the missing info.
- Example: “Price query needs a specific city or area. Which city in Hokkaido (e.g., Sapporo, Niseko)?”
Step 3: Execute Tool
Call INLINECODE13
Headers:
- - INLINECODE14
- INLINECODE15
Body:
CODEBLOCK2
Response format (from Agent Earth backend):
Success:
CODEBLOCK3
Failure:
CODEBLOCK4
Step 4: Results & Fallback
- - Success: answer the user based on the tool result.
- Failure: try the next tool in the list.
- All failed: be transparent and suggest manual directions.
Usage Protocol
1. Context Resolution
Users often use pronouns (“there”, “it”, “these days”). Before
recommend, resolve references.
- - Bad: Query = “housing prices there”
- Good: Query = “housing prices in Hokkaido”
2. Complex Intent Decomposition
For “Is it suitable these days?”, decompose into objective data:
- - Weather (temp, snow)
- Traffic/news (incidents)
- Agent strategy: start with weather or travel-advice tools
3. Data Freshness
For news (“latest situation”), prices (“housing prices”), you MUST use tools; never invent from training data.
Example Dialogs
Example 1: News
User: “Introduce the latest situation in Iran.”
Agent reasoning: news requirement.
Action:
- 1. Recommend Query: “latest Iran situation”
- Tool Selected: INLINECODE17
- Execute Params: INLINECODE18
- Response: summarize returned articles.
Example 2: Decision Support (weather + advice)
User: “I want to ski in Hokkaido. Is it suitable these days?”
Agent reasoning: need weather + ski conditions.
Action:
- 1. Recommend Query: “Hokkaido ski weather forecast and suitability”
- Tool Selected:
weather_forecast_tool (or travel advice) - Execute Params: INLINECODE20
- Response: provide recommendation based on forecast.
Example 3: Context Inheritance (price query)
User: “I decided to ski in Hokkaido. How are the housing prices there?”
Agent reasoning: “there” = Hokkaido; need housing prices.
Action:
- 1. Recommend Query: “Hokkaido ski resort housing prices”
- Tool Selected:
hotel_booking_tool or INLINECODE22 - Execute Params: INLINECODE23
- Response: show ranges and recommendations.
References
See references/api-spevification.md for full API specifications.
技能概述
该技能基于Agent Earth,实现了工具发现与执行的完整工作流自动化。基础地址为 https://agentearth.ai:
用户自然语言查询 → 调用推荐API → 语义匹配与选择 → 执行最佳工具 → 返回结果
核心价值:
- - 主动发现:无需记忆工具清单,只需描述意图即可。
- 上下文感知:理解多轮对话中的隐式参数(例如“那里的价格”)。
- 决策支持:不仅能获取数据,还能支持“是否合适”、“建议”类问题。
身份验证
所有对 https://agentearth.ai 的请求(包括推荐和执行)必须包含以下请求头:
- - 请求头名称:X-Api-Key
- 请求头值:EARTHAPIKEY>
- 注意:该值来自环境变量 $AGENTEARTHAPIKEY。
- 获取密钥:访问官方网站 https://agentearth.ai/,在个人资料中生成API密钥。
使用时机
当用户表达以下任何意图时,使用此技能:
- - 时事新闻:“我想了解伊朗的最新局势...”
- 决策咨询:“这些天北海道适合滑雪吗?”(天气、雪况、旅行建议)
- 特定数据:“北海道的房价如何?”(酒店/民宿,继承‘北海道’上下文)
- 功能调用:“帮我找一个可以翻译文档的工具。”
- 任何需要外部信息的场景
工作流程
步骤1:调用推荐API
向 POST https://agentearth.ai/agent-api/v1/tool/recommend 发送JSON
请求头:
- - Content-Type: application/json
- X-Api-Key: $AGENTEARTHAPI_KEY
请求体:
json
{
query: <包含上下文的完整自然语言描述>,
task_context: 可选的任务上下文
}
上下文注入:
如果用户的请求依赖于上下文(例如“那里的房价”),则必须在 query 中明确补全信息,或通过 task_context 传递。
- - 用户输入:“那里的房价如何?”
- 历史记录:“我想去北海道滑雪”
- 最终查询:“北海道滑雪胜地的房价”
步骤2:选择
分析推荐结果(tools 列表),优先级:
- 1. 直接匹配:工具描述与任务高度匹配。
- 组合能力:对于多步骤任务(例如“是否合适”需要天气+新闻),优先选择综合工具或计划多次调用。
步骤2.5:参数验证
在调用执行之前,根据所选工具的 input_schema 进行验证:
- 1. 必填字段:确保所有 required: true 的参数可以从输入或对话历史中提取。
- 缺失处理:
- 如果必填参数缺失,不要调用执行。
- 向用户询问缺失信息。
- 示例:“价格查询需要具体的城市或区域。北海道的哪个城市(例如札幌、新雪谷町)?”
步骤3:执行工具
调用 POST https://agentearth.ai/agent-api/v1/tool/execute
请求头:
- - Content-Type: application/json
- X-Api-Key: $AGENTEARTHAPI_KEY
请求体:
json
{
tool_name: <所选工具名称>,
arguments: {},
session_id: 可选
}
响应格式(来自Agent Earth后端):
成功:
json
{
result: { },
status: success
}
失败:
json
{
status: error,
message: 城市参数不能为空
}
步骤4:结果与回退
- - 成功:根据工具结果回答用户。
- 失败:尝试列表中的下一个工具。
- 全部失败:坦诚告知并建议手动方向。
使用协议
1. 上下文解析
用户经常使用代词(“那里”、“它”、“这些天”)。在 recommend 之前,解析指代。
- - 错误:查询 = “那里的房价”
- 正确:查询 = “北海道的房价”
2. 复杂意图分解
对于“这些天是否合适?”,分解为客观数据:
- - 天气(温度、雪况)
- 交通/新闻(事件)
- 代理策略:从天气或旅行建议工具开始
3. 数据时效性
对于新闻(“最新局势”)、价格(“房价”),必须使用工具;切勿从训练数据中编造。
示例对话
示例1:新闻
用户:“介绍一下伊朗的最新局势。”
代理推理:新闻需求。
操作:
- 1. 推荐查询:“伊朗最新局势”
- 选择工具:newssearchtool
- 执行参数:{keyword: 伊朗, time_range: 最新}
- 响应:总结返回的文章。
示例2:决策支持(天气+建议)
用户:“我想去北海道滑雪。这些天适合吗?”
代理推理:需要天气+滑雪条件。
操作:
- 1. 推荐查询:“北海道滑雪天气预报及适宜性”
- 选择工具:weatherforecasttool(或旅行建议)
- 执行参数:{city: 北海道, activity: 滑雪}
- 响应:根据预报提供建议。
示例3:上下文继承(价格查询)
用户:“我决定去北海道滑雪。那里的房价如何?”
代理推理:“那里”=北海道;需要房价。
操作:
- 1. 推荐查询:“北海道滑雪胜地房价”
- 选择工具:hotelbookingtool 或 pricesearchtool
- 执行参数:{location: 北海道, category: 酒店, query: 价格}
- 响应:显示价格区间和建议。
参考资料
完整API规范请参见 references/api-spevification.md。