Learn how the Senpilot CX Tool Manager works and how to integrate it with your AI agents.
The Senpilot CX Tool Manager is a multi-tenant middleware service that enables AI agents to access utility customer data through standardized tool interfaces. It routes tool calls to either internal databases or external APIs based on tenant-specific configurations.
Multi-tenant
Each tenant has isolated configurations
Flexible Routing
Internal DB or external APIs per tool
Secure
Auth tokens stored in secrets manager
Request Received
Agent calls POST /api/tools/execute with tenantId, toolName, and input parameters
Validation
Tenant status checked (must be active), input validated against tool schema
Connector Selection
Based on tenant's tool config, routes to Internal DB connector or External REST connector
Execution & Response
Tool executed, result logged, and canonical response returned with metadata
Routes tool calls to the internal Senpilot database. Ideal for tenants who store their customer data directly in the platform.
Routes tool calls to an external REST API. Perfect for integrating with existing utility systems or third-party services.
check_account_balanceRetrieve current account balance, due date, and payment history
Inputs:
Outputs:
check_outage_mapCheck active outages and estimated restoration times by location
Inputs:
Outputs:
check_current_meterGet the current meter reading and usage information
Inputs:
Outputs:
analyze_meterAnalyze meter usage patterns, trends, and anomalies over time
Inputs:
Outputs:
analyze_billsAnalyze billing history and payment patterns
Inputs:
Outputs:
create_ticketCreate a support ticket for customer issues
Inputs:
Outputs:
POST /api/tools/execute
Content-Type: application/json
{
"tenantId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"toolName": "check_account_balance",
"input": {
"accountNumber": "ACC-12345"
}
}{
"success": true,
"data": {
"utilityCompany": "ZapCo Electric",
"accountNumber": "ACC-12345",
"currentBalance": 142.50,
"dueDate": "2025-01-15",
"pastDueAmount": 0,
"accountStatus": "current"
},
"metadata": {
"executionTimeMs": 45,
"source": "internal_db",
"tenantId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"toolName": "check_account_balance"
}
}GET /api/tools/definitions?tenantId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d # Returns tool schemas in a format suitable for LLM function calling
POST /api/tenants/{tenantId}/tools
Content-Type: application/json
{
"toolName": "check_account_balance",
"sourceType": "EXTERNAL_REST",
"enabled": true,
"endpointUrl": "https://api.myutility.com/v1/billing",
"authType": "API_KEY",
"authSecretRef": "my-utility-api-key",
"configJson": {
"method": "GET",
"pathSuffix": "/balance"
},
"fieldMappings": {
"accountNumber": "account_id",
"currentBalance": "balance_due"
}
}When integrating with external APIs that use different field names, configure field mappings to translate between canonical names and the external API's schema.
| Canonical Field | External API Field | Direction |
|---|---|---|
| accountNumber | account_id | Input |
| currentBalance | balance_amount | Output |
| dueDate | payment_due | Output |
Sends API key in a custom header (default: X-API-Key)
Sends token in Authorization: Bearer <token> header
OAuth 2.0 flow with automatic token refresh (coming soon)
No authentication required (for public APIs)
Secrets are stored securely and referenced by name via authSecretRef. In production, secrets are resolved from AWS Secrets Manager, HashiCorp Vault, or environment variables.