tool-factory.ts•1.01 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { CreateTools } from "./create/index.js";
import { DeleteTools } from "./delete/index.js";
import { GetTools } from "./get/index.js";
import { ListTools } from "./list/index.js";
import { UpdateTools } from "./update/index.js";
export function ToolFactory(server: McpServer) {
DeleteTools.map((tool) => tool()).forEach((tool) =>
server.tool(tool.name, tool.description, tool.schema, tool.handler),
);
GetTools.map((tool) => tool()).forEach((tool) =>
server.tool(tool.name, tool.description, tool.schema, tool.handler),
);
CreateTools.map((tool) => tool()).forEach((tool) =>
server.tool(tool.name, tool.description, tool.schema, tool.handler),
);
ListTools.map((tool) => tool()).forEach((tool) =>
server.tool(tool.name, tool.description, tool.schema, tool.handler),
);
UpdateTools.map((tool) => tool()).forEach((tool) =>
server.tool(tool.name, tool.description, tool.schema, tool.handler),
);
}