taobao-mcp-demo
Version:
淘宝MCP演示服务器 - 提供基础工具和资源
17 lines (16 loc) • 407 B
JavaScript
import { z } from "zod";
// 加法工具
export const addTool = {
name: "add",
config: {
title: "加法工具",
description: "计算两个数字的和",
inputSchema: {
a: z.number().describe("第一个数字"),
b: z.number().describe("第二个数字")
}
},
handler: async ({ a, b }) => ({
content: [{ type: "text", text: String(a + b) }]
})
};