mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix(mcp): fix allowedTools undefined semantics; remove unused import and color field
This commit is contained in:
parent
76a4415ecd
commit
ed1993d016
3 changed files with 2 additions and 8 deletions
|
|
@ -17,7 +17,6 @@ import {
|
|||
CrudOp,
|
||||
MCPToolEntry,
|
||||
CRUD_GROUP_META,
|
||||
classifyToolOp,
|
||||
groupToolsByCrud,
|
||||
} from "../../utils/mcpToolCrudClassification";
|
||||
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ const MCPToolConfiguration: React.FC<MCPToolConfigurationProps> = ({
|
|||
<McpCrudPermissionPanel
|
||||
tools={tools}
|
||||
searchFilter={toolSearchTerm}
|
||||
value={allowedTools ?? undefined}
|
||||
value={allowedTools.length === 0 ? undefined : allowedTools}
|
||||
onChange={(allowed) => onAllowedToolsChange(allowed)}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -56,36 +56,31 @@ export function groupToolsByCrud(tools: MCPToolEntry[]): Record<CrudOp, MCPToolE
|
|||
|
||||
export const CRUD_GROUP_META: Record<
|
||||
CrudOp,
|
||||
{ label: string; description: string; risk: "low" | "medium" | "high" | "unknown"; color: string }
|
||||
{ label: string; description: string; risk: "low" | "medium" | "high" | "unknown" }
|
||||
> = {
|
||||
read: {
|
||||
label: "Read",
|
||||
description: "Safe operations — fetch, list, search. No side effects.",
|
||||
risk: "low",
|
||||
color: "green",
|
||||
},
|
||||
create: {
|
||||
label: "Create",
|
||||
description: "Add new resources — insert, upload, register.",
|
||||
risk: "medium",
|
||||
color: "blue",
|
||||
},
|
||||
update: {
|
||||
label: "Update",
|
||||
description: "Modify existing resources — edit, patch, rename.",
|
||||
risk: "medium",
|
||||
color: "yellow",
|
||||
},
|
||||
delete: {
|
||||
label: "Delete",
|
||||
description: "Destructive operations — remove, purge, destroy.",
|
||||
risk: "high",
|
||||
color: "red",
|
||||
},
|
||||
unknown: {
|
||||
label: "Other",
|
||||
description: "Operations that could not be automatically classified.",
|
||||
risk: "unknown",
|
||||
color: "gray",
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue