Veto/docs

Tools API

Register, list, retrieve, and delete tool definitions — the schema Veto uses to generate and enforce policies.

Tools are the building blocks of Veto policies. Each tool describes a callable action with typed arguments. When a tool is registered, Veto auto-generates a starter policy if none exists.

All endpoints require authentication via API key (X-Veto-API-Key) or Bearer JWT with X-Organization-Id header.

POST /v1/tools/register

Register tools from the SDK. Accepts the SDK's parameters format (snake_case fields, nullable optionals). If a tool is new and has no policy, Veto generates a starter policy automatically.

Headers

HeaderRequiredDescription
X-Veto-API-Key or AuthorizationYesAPI key or Bearer JWT
Content-TypeYesapplication/json

Body

{
  "tools": [
    {
      "name": "send_email",
      "description": "Send an email to a recipient",
      "parameters": [
        {
          "name": "to",
          "type": "string",
          "description": "Recipient email address",
          "required": true
        },
        {
          "name": "subject",
          "type": "string",
          "description": "Email subject line",
          "required": true
        },
        {
          "name": "body",
          "type": "string",
          "description": "Email body content",
          "required": false
        }
      ]
    }
  ]
}
FieldTypeRequiredDescription
toolsarrayYesOne or more tool definitions (min 1)
tools[].namestringYesTool name (min 1 char)
tools[].descriptionstring?NoHuman-readable description
tools[].parametersarrayYesParameter definitions
tools[].parameters[].namestringYesParameter name
tools[].parameters[].type"string" | "number" | "boolean" | "array" | "object"YesParameter type
tools[].parameters[].descriptionstring?NoParameter description
tools[].parameters[].requiredboolean?NoWhether the parameter is required
tools[].parameters[].enumstring[]?NoAllowed values
tools[].parameters[].minimumnumber?NoMinimum numeric value
tools[].parameters[].maximumnumber?NoMaximum numeric value
tools[].parameters[].patternstring?NoRegex pattern for validation

Response

{
  "success": true,
  "registered_tools": ["send_email"],
  "message": "Registered 1 tool(s)"
}
FieldTypeDescription
successbooleanAlways true on success
registered_toolsstring[]Names of registered tools
messagestringHuman-readable summary

Example

curl -X POST https://api.veto.so/v1/tools/register \
  -H "X-Veto-API-Key: veto_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "tools": [
      {
        "name": "transfer_funds",
        "description": "Transfer money between accounts",
        "parameters": [
          { "name": "amount", "type": "number", "required": true },
          { "name": "to", "type": "string", "required": true },
          { "name": "currency", "type": "string", "required": false }
        ]
      }
    ]
  }'

POST /v1/tools/sync

Sync tools from the dashboard or external integrations. Uses the server-native arguments format. Like register, auto-generates starter policies for new tools.

Headers

HeaderRequiredDescription
X-Veto-API-Key or AuthorizationYesAPI key or Bearer JWT
Content-TypeYesapplication/json

Body

{
  "tools": [
    {
      "name": "send_email",
      "description": "Send an email to a recipient",
      "arguments": [
        {
          "name": "to",
          "type": "string",
          "description": "Recipient email address",
          "required": true
        },
        {
          "name": "subject",
          "type": "string"
        }
      ]
    }
  ]
}
FieldTypeRequiredDescription
toolsarrayYesOne or more tool definitions (min 1)
tools[].namestringYesTool name (min 1 char)
tools[].descriptionstring?NoHuman-readable description
tools[].argumentsarrayYesArgument definitions
tools[].arguments[].namestringYesArgument name
tools[].arguments[].type"string" | "number" | "boolean" | "array" | "object"YesArgument type
tools[].arguments[].descriptionstring?NoArgument description
tools[].arguments[].requiredboolean?NoWhether the argument is required

Response

{
  "synced": 2,
  "tools": [
    { "name": "send_email", "status": "created" },
    { "name": "transfer_funds", "status": "updated" }
  ],
  "policiesGenerated": 1
}
FieldTypeDescription
syncednumberNumber of tools processed
toolsarrayPer-tool sync results
tools[].namestringTool name
tools[].status"created" | "updated"Whether the tool was new or already existed
policiesGeneratednumberNumber of starter policies auto-generated

Example

curl -X POST https://api.veto.so/v1/tools/sync \
  -H "X-Veto-API-Key: veto_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "tools": [
      {
        "name": "delete_record",
        "description": "Delete a database record",
        "arguments": [
          { "name": "id", "type": "string", "required": true },
          { "name": "table", "type": "string", "required": true }
        ]
      }
    ]
  }'

POST /v1/tools/validate

Validate a tool call against policies. This is the core validation endpoint used by the SDK. See POST /v1/validate for full documentation.

GET /v1/tools

List all registered tools for the authenticated organization.

Headers

HeaderRequiredDescription
X-Veto-API-Key or AuthorizationYesAPI key or Bearer JWT

Response

{
  "data": [
    {
      "name": "send_email",
      "description": "Send an email to a recipient",
      "arguments": [
        {
          "name": "to",
          "type": "string",
          "description": "Recipient email address",
          "required": true
        },
        {
          "name": "subject",
          "type": "string",
          "required": true
        }
      ],
      "createdAt": "2025-01-15T10:00:00Z",
      "updatedAt": "2025-01-20T14:30:00Z"
    }
  ]
}

Example

curl https://api.veto.so/v1/tools \
  -H "X-Veto-API-Key: veto_abc123..."

GET /v1/tools/:name

Get a single tool by name.

Headers

HeaderRequiredDescription
X-Veto-API-Key or AuthorizationYesAPI key or Bearer JWT

Path parameters

ParameterTypeDescription
namestringThe tool name

Response

{
  "name": "send_email",
  "description": "Send an email to a recipient",
  "arguments": [
    {
      "name": "to",
      "type": "string",
      "description": "Recipient email address",
      "required": true
    }
  ],
  "createdAt": "2025-01-15T10:00:00Z",
  "updatedAt": "2025-01-20T14:30:00Z"
}

Errors

StatusCodeDescription
404not_foundTool does not exist

Example

curl https://api.veto.so/v1/tools/send_email \
  -H "X-Veto-API-Key: veto_abc123..."

DELETE /v1/tools/:name

Delete a tool and its associated policy. This removes both the tool definition and any policy that targets it.

Headers

HeaderRequiredDescription
X-Veto-API-Key or AuthorizationYesAPI key or Bearer JWT

Path parameters

ParameterTypeDescription
namestringThe tool name

Response

{
  "success": true
}

Errors

StatusCodeDescription
404not_foundTool does not exist

Example

curl -X DELETE https://api.veto.so/v1/tools/send_email \
  -H "X-Veto-API-Key: veto_abc123..."

Tool argument fields

FieldTypeDescription
namestringArgument name
type"string" | "number" | "boolean" | "array" | "object"Argument type
descriptionstring?Human-readable description
requiredboolean?Whether the argument must be provided

SDK behavior

The TypeScript and Python SDKs call POST /v1/tools/register automatically on initialization when autoRegister is enabled. This registers all tools the agent has access to and ensures policies exist for each one.

const veto = new Veto({
  apiKey: 'veto_abc123...',
  autoRegister: true,
  tools: [
    {
      name: 'send_email',
      parameters: [
        { name: 'to', type: 'string', required: true },
        { name: 'body', type: 'string' },
      ],
    },
  ],
});