mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
add update and delete mutations
This commit is contained in:
parent
568ec2f7d5
commit
5a7bf0b35f
8 changed files with 114 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue