Skip to main content
POST
/
api
/
mcp-servers
/
{mcpServerId}
/
tool-approvals
curl -X POST "https://api.zudu.ai/api/mcp-servers/mcp_abc123def456/tool-approvals" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
  -d '{
    "tool_name": "send_email",
    "tool_description": "Send an email to a recipient",
    "tool_hash": "abc123def456...",
    "input_schema": {
      "type": "object",
      "properties": {
        "to": {"type": "string"},
        "subject": {"type": "string"},
        "body": {"type": "string"}
    },
    "approval_policy": "requires_approval"
  }'
{
  "message": "Tool approval added successfully",
  "status": "success",
  "error": null,
  "data": {
    "mcp_server_id": "mcp_abc123def456",
    "tool_name": "send_email",
    "tool_description": "Send an email to a recipient",
    "tool_hash": "abc123def456...",
    "input_schema": {
      "type": "object",
      "properties": {
        "to": {"type": "string"},
        "subject": {"type": "string"},
        "body": {"type": "string"}
    },
    "approval_policy": "requires_approval",
    "created_at": 1705321000000,
    "server": {
      "id": "mcp_abc123def456",
      "server_name": "My MCP Server",
      "approval_policy": "require_approval_per_tool"
    }
}
Add a tool approval configuration to an MCP server. This allows fine-grained control over which tools require approval before execution.
curl -X POST "https://api.zudu.ai/api/mcp-servers/mcp_abc123def456/tool-approvals" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
  -d '{
    "tool_name": "send_email",
    "tool_description": "Send an email to a recipient",
    "tool_hash": "abc123def456...",
    "input_schema": {
      "type": "object",
      "properties": {
        "to": {"type": "string"},
        "subject": {"type": "string"},
        "body": {"type": "string"}
    },
    "approval_policy": "requires_approval"
  }'
{
  "message": "Tool approval added successfully",
  "status": "success",
  "error": null,
  "data": {
    "mcp_server_id": "mcp_abc123def456",
    "tool_name": "send_email",
    "tool_description": "Send an email to a recipient",
    "tool_hash": "abc123def456...",
    "input_schema": {
      "type": "object",
      "properties": {
        "to": {"type": "string"},
        "subject": {"type": "string"},
        "body": {"type": "string"}
    },
    "approval_policy": "requires_approval",
    "created_at": 1705321000000,
    "server": {
      "id": "mcp_abc123def456",
      "server_name": "My MCP Server",
      "approval_policy": "require_approval_per_tool"
    }
}

Headers

X-API-KEY
string
required
Your API key (format: sk_...)
X-API-SECRET
string
required
Your API secret (format: s3cr3t_...)

Path Parameters

mcpServerId
string
required
The MCP server ID (format: mcp_...)Example: mcp_abc123def456

Request Body

tool_name
string
required
Name of the tool that requires approval
  • Maximum length: 255 characters
  • Must match the tool name from the MCP server
Example: "send_email"
tool_description
string
required
Description of what the tool does
  • Maximum length: 1000 characters
Example: "Send an email to a recipient"
tool_hash
string
Hash identifier for the tool (optional)
  • Maximum length: 500 characters
  • Used for tool versioning and change detection
Example: "abc123def456..."
input_schema
object
JSON schema defining the tool’s input parametersFollows JSON Schema specification.Example:
{
  "type": "object",
  "properties": {
    "to": {"type": "string"},
    "subject": {"type": "string"},
    "body": {"type": "string"},
  "required": ["to", "subject"]
}
approval_policy
string
Approval policy for this specific toolOptions:
  • auto_approved - Automatically approve this tool without manual approval
  • requires_approval - Require manual approval before executing this tool
Default: requires_approval

Response Fields

mcp_server_id
string
The MCP server ID this tool approval belongs to
tool_name
string
Name of the tool
tool_description
string
Description of the tool
tool_hash
string
Tool hash if provided
input_schema
object
Input schema for the tool
approval_policy
string
Approval policy for this tool
created_at
number
Unix timestamp (milliseconds) when approval was created
server
object
Full MCP server object (for ElevenLabs API compatibility)

Error Responses

error
string
Bad Request - Validation error
{
  "message": "Validation failed",
  "status": "error",
  "error": "Tool name is required"
}
error
string
Not Found - MCP server does not exist
{
  "message": "MCP server not found",
  "status": "error",
  "error": "MCP server with ID 'mcp_abc123' does not exist in organization"
}
error
string
Unauthorized - Missing or invalid API key/secret
error
string
Internal Server Error - Failed to add tool approval
{
  "message": "Failed to add tool approval",
  "status": "error",
  "error": "Database connection failed"
}

Notes

  • Tool approvals are used when the server’s approval policy is set to require_approval_per_tool
  • Each tool can have its own approval policy independent of the server’s default policy
  • Tool hash helps track tool changes and versioning
  • Input schema helps validate tool parameters before execution
  • The response includes the full server object for ElevenLabs API compatibility