AI Tools
一次定义 LLM 工具,同时生成 OpenAI、Anthropic、Gemini 三家经过校验的函数调用 payload。
用三种语言从你的代码中调用此工具。
curl -X POST 'http://127.0.0.1:3003/zh/api/tools/llm-tool-calling-json-schema-builder' \
-H 'Content-Type: application/json' \
-d '{"toolName":"get_weather","toolDescription":"Get the current weather for a city. Use when the user asks about temperature, conditions, or whether it will rain today.","paramsInput":"city | string | required | City name, e.g. \"Paris\"\nunits | enum<celsius,fahrenheit> | optional | Temperature unit for the report\nforecast_days | integer | optional | Days of forecast to include (1-7)","strictMode":true,"toolChoice":"auto"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST http://127.0.0.1:3003/zh/api/tools/llm-tool-calling-json-schema-builder| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| toolName | text | 是 | — |
| toolDescription | textarea | 是 | — |
| paramsInput | textarea | 是 | — |
| strictMode | checkbox | 否 | — |
| toolChoice | select | 是 | — |
将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-llm-tool-calling-json-schema-builder": {
"name": "llm-tool-calling-json-schema-builder",
"description": "一次定义 LLM 工具,同时生成 OpenAI、Anthropic、Gemini 三家经过校验的函数调用 payload。",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=llm-tool-calling-json-schema-builder",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "llm-tool-calling-json-schema-builder",
"arguments": {
"toolName": "get_weather",
"toolDescription": "Get the current weather for a city. Use when the user asks about temperature, conditions, or whether it will rain today.",
"paramsInput": "city | string | required | City name, e.g. \"Paris\"\nunits | enum<celsius,fahrenheit> | optional | Temperature unit for the report\nforecast_days | integer | optional | Days of forecast to include (1-7)",
"strictMode": true,
"toolChoice": "auto"
}
}
}有问题或反馈?请联系 [email protected]
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}