Add Tool Command

The agent tools add command adds and configures a new tool for an AI Agent, enabling additional capabilities like Notion integration, Slack communication, etc.

Usage

xpander agent tools add <agent_id> <tool_name> [--config <json>] [--auth <auth_type>]

Options

OptionDescription
--config <json>Optional. Tool-specific configuration in JSON format
--auth <auth_type>Optional. Authentication type: oauth2, api_key, basic

Examples

Add Notion Tool

xpander agent tools add agent_123 notion \
  --config '{
    "workspace": "Support Team",
    "permissions": ["read", "write"],
    "default_database": "customer-tickets"
  }'

Response:

Adding Notion Tool
=================
Agent: Support Agent (agent_123)
Tool: notion

Step 1/3: Authentication
✓ Opening browser for OAuth authentication...
✓ Authentication successful

Step 2/3: Configuration
✓ Workspace access granted
✓ Permissions configured
✓ Default database connected

Step 3/3: Testing Connection
✓ API connection verified
✓ Permissions validated
✓ Test operation successful

Tool successfully added and configured!

Add GitHub Tool with API Key

xpander agent tools add agent_123 github \
  --auth api_key \
  --config '{
    "repositories": ["org/repo1", "org/repo2"],
    "permissions": ["issues", "pull_requests"],
    "api_key": "ghp_..."
  }'

Add Slack Tool

xpander agent tools add agent_123 slack \
  --config '{
    "channels": ["#support", "#general"],
    "bot_name": "Support Assistant",
    "allowed_mentions": ["users", "channels"]
  }'

Tool-specific Configurations

Different tools require different configurations. Here are some common tools and their configurations:

Notion

{
  "workspace": "string",
  "permissions": ["read", "write", "share"],
  "default_database": "string",
  "page_templates": ["template1", "template2"]
}

Slack

{
  "channels": ["string"],
  "bot_name": "string",
  "allowed_mentions": ["users", "channels", "everyone"],
  "default_channel": "string"
}

GitHub

{
  "repositories": ["string"],
  "permissions": ["issues", "pull_requests", "code"],
  "default_branch": "string",
  "label_prefix": "string"
}

Notes

  • Authentication:
    • OAuth2 will open a browser for authentication
    • API keys can be provided via config or environment variables
    • Basic auth requires username and password
  • Configuration:
    • Each tool has its own required and optional settings
    • Use xpander agent tools list to see available tools
    • Configuration can be updated later using this same command
  • Permissions:
    • Tools are configured with least-privilege access by default
    • Expand permissions only as needed
    • Regular audit logs are available for tool usage