Tool Schema
{
"name": "weather_get",
"description": "获取指定城市的天气信息",
"inputSchema": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "城市名称"
},
"format": {
"type": "string",
"enum": ["json", "text"]
}
},
"required": ["city"]
}
}
实际调用示例
// LLM 生成
{
"tool": "weather_get",
"parameters": {
"city": "Beijing",
"format": "json"
}
}
// 返回结果
{
"current_condition": {
"temp_C": 15,
"weather": "晴"
},
"weather": [
{"date": "明天", "avgtempC": 16}
]
}