add update and delete mutations

This commit is contained in:
Dustin Healy 2025-06-27 12:30:38 -07:00
parent 568ec2f7d5
commit 5a7bf0b35f
8 changed files with 114 additions and 11 deletions

View file

@ -1,5 +1,5 @@
const express = require('express');
const { addTool } = require('@librechat/api');
const { addTool, updateTool, deleteTool } = require('@librechat/api');
const { callTool, verifyToolAuth, getToolCalls } = require('~/server/controllers/tools');
const { getAvailableTools } = require('~/server/controllers/PluginController');
const { toolCallLimiter } = require('~/server/middleware/limiters');
@ -45,4 +45,21 @@ router.post('/:toolId/call', toolCallLimiter, callTool);
*/
router.post('/add', addTool);
/**
* Update an existing tool/MCP in the system
* @route PUT /agents/tools/:mcp_id
* @param {string} mcp_id - The ID of the MCP to update
* @param {object} req.body - Request body containing updated tool/MCP data
* @returns {object} Updated tool/MCP object
*/
router.put('/:mcp_id', updateTool);
/**
* Delete a tool/MCP from the system
* @route DELETE /agents/tools/:mcp_id
* @param {string} mcp_id - The ID of the MCP to delete
* @returns {object} Deletion confirmation
*/
router.delete('/:mcp_id', deleteTool);
module.exports = router;