Skip to content
PUT/api/v1/mcp/permissions/{id}

Update an MCP tool permission

Patch fields on a per-tool RBAC row (mcp_tool_permissions). Admin role required. Resolves org via mcp_tool_permissions.server_id → mcp_servers.org_id for the membership precheck.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Parameters

id in pathrequired

mcp_tool_permissions row id

string

Request body required

Example

{
  "allowedRoles": [
    "string"
  ],
  "rateLimitPerMinute": 0,
  "riskLevel": "low",
  "notes": "string"
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "allowedRoles": {
          "maxItems": 50,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        },
        "rateLimitPerMinute": {
          "nullable": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000
        },
        "riskLevel": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high",
            "critical"
          ]
        },
        "notes": {
          "nullable": true,
          "type": "string",
          "maxLength": 10000
        }
      },
      "additionalProperties": {}
    }
  }
}

Response

200 example

{
  "success": true
}

All status codes

200Permission updated.
400(no description)
401(no description)
403Forbidden — admin role required.
404Permission row not found.
429(no description)
500Internal Server Error — DB_ERROR.

Code samples

cURL

# {id} is shown with an EXAMPLE value — replace it with real values.
curl -X PUT \
  https://evalguard.ai/api/v1/mcp/permissions/00000000-0000-0000-0000-000000000000 \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "allowedRoles": [ "string" ], "rateLimitPerMinute": 0, "riskLevel": "low", "notes": "string" }'

TypeScript

// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {id} is shown with an EXAMPLE value — replace it with real values.

const res = await fetch("https://evalguard.ai/api/v1/mcp/permissions/00000000-0000-0000-0000-000000000000", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "allowedRoles": [
      "string"
    ],
    "rateLimitPerMinute": 0,
    "riskLevel": "low",
    "notes": "string"
  }),
});
console.log(res.status, await res.json());

Python

# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {id} is shown with an EXAMPLE value — replace it with real values.

import os
import requests

headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
headers["Content-Type"] = "application/json"

response = requests.request(
    "PUT",
    "https://evalguard.ai/api/v1/mcp/permissions/00000000-0000-0000-0000-000000000000",
    headers=headers,
    json={
    "allowedRoles": [
        "string"
    ],
    "rateLimitPerMinute": 0,
    "riskLevel": "low",
    "notes": "string"
},
)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
	"strings"
)

// {id} is shown with an EXAMPLE value — replace it with real values.
func main() {
	body := strings.NewReader(`{"allowedRoles":["string"],"rateLimitPerMinute":0,"riskLevel":"low","notes":"string"}`)
	req, _ := http.NewRequestWithContext(context.Background(), "PUT", "https://evalguard.ai/api/v1/mcp/permissions/00000000-0000-0000-0000-000000000000", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400401403404429500

Other MCP endpoints