AI Agent Tools Reference
Relevant source files
The following files were used as context for generating this wiki page:
The AI agent tools are the core components that enable the TalkCRM voice assistant to interact with and manipulate data within a user's Salesforce organization. These tools act as a bridge between the natural language processing capabilities of the AI (Claude, via ElevenLabs) and the backend logic (Convex) that communicates with the Salesforce REST API. By exposing a set of specific functions, the AI can translate a user's spoken request, such as "Update the Acme deal to Closed Won," into a concrete action performed on the CRM.
This reference documents the available tools, their purpose, and the underlying architecture that powers them. The system is designed to be extensible, with different agents being configured with different toolsets, such as Salesforce tools for CRM management or Cal.com tools for scheduling.
Sources: README.md:33-34, agent_configs/SIMPLE-Co-Sales-Agent.json:96-101, agent_configs/TalkCRM.json:90-97, PROJECT_DESCRIPTION.md:19-27
System Architecture
The tools are invoked as part of a larger system architecture that connects the user's phone call to the Salesforce API. The ElevenLabs Conversational AI agent acts as the central orchestrator, calling tools which are implemented as webhook-enabled HTTP endpoints in the Convex backend.
This diagram illustrates the data flow from a user's voice command to a Salesforce update.
Sources: README.md:11-31, PROJECT_DESCRIPTION.md:29-32
AI Intent Processing
When a user speaks, their natural language input is processed by the askSalesforce action in the Convex backend. This action uses the Claude AI model to interpret the user's intent and translate it into a structured JSON object. The action field in this object determines which Salesforce operation to execute.
This flowchart shows the logic within the askSalesforce action.
Sources: convex/ai.ts:187-359
The AI is provided with extensive context to make accurate decisions, including a static schema of standard Salesforce objects and a dynamically synced schema of the user's custom objects.
// convex/ai.ts:8-166
// Salesforce schema context - tells Claude what's available
const SALESFORCE_SCHEMA_CONTEXT = `
You are a Salesforce assistant helping a sales rep via voice. You have access to these Salesforce objects and their key fields:
STANDARD OBJECTS:
- Account: Id, Name, Type, Industry, AnnualRevenue, Phone, Website, BillingCity, BillingState, OwnerId
- Contact: Id, Name, FirstName, LastName, Email, Phone, AccountId, Title, OwnerId
- Lead: Id, Name, FirstName, LastName, Email, Phone, Company, Status, LeadSource, OwnerId
- Opportunity: Id, Name, Amount, StageName, CloseDate, Probability, AccountId, OwnerId, IsClosed, IsWon
- Task: Id, Subject, Status, Priority, ActivityDate, WhoId (Contact/Lead), WhatId (Account/Opp), OwnerId, Description
- Case: Id, CaseNumber, Subject, Status, Priority, AccountId, ContactId, OwnerId
...
`;
Sources: convex/ai.ts:8-166, convex/ai.ts:200-282
Salesforce Tools
The primary toolset for TalkCRM is focused on Salesforce interactions. These tools are defined in the agent's configuration and prompt, instructing the AI on how and when to use them.
| Tool Name | Description | Agent Config Source |
|---|---|---|
search_salesforce | Find accounts, contacts, opportunities, leads by name or keyword. | agent_configs/TalkCRM.json:91 |
get_record | Get full details of a specific record by ID. | agent_configs/TalkCRM.json:92 |
create_record | Create new accounts, contacts, leads, tasks, opportunities. | agent_configs/TalkCRM.json:93 |
update_record | Update existing records (change stage, status, amounts, etc.). | agent_configs/TalkCRM.json:94 |
log_call | Log a call activity to Salesforce. | agent_configs/TalkCRM.json:95 |
get_my_tasks | Get your open tasks and to-dos. | agent_configs/TalkCRM.json:96 |
get_my_pipeline | Get your opportunities and pipeline summary. | agent_configs/TalkCRM.json:97 |
Sources: README.md:35-41, agent_configs/TalkCRM.json:90-97
Tool Usage Example
The agent's prompt provides explicit instructions and examples for using these tools in a conversational flow.
// agent_configs/TalkCRM.json:104-110
" \"Find Acme\" or \"Look up John Smith\"\n \u2192 Use search_salesforce with the name\n \u2192 \"Found Acme Corp - $50k deal in Negotiation. You're close, let's lock it in!\"\n\n \"Update Acme deal to Closed Won\"\n \u2192 First search to get the record ID\n \u2192 Confirm: \"Let's go! Marking Acme as Closed Won - that's a win, right?\"\n \u2192 Use update_record with the ID\n \u2192 Celebrate: \"Done! Another one in the books. You're on fire!\""
Sources: agent_configs/TalkCRM.json:104-110
The following sequence diagram shows the interaction for the "Update Acme deal to Closed Won" command.
Scheduling Tools (Cal.com)
In addition to Salesforce tools, agents can be configured with other integrations, such as Cal.com for scheduling. The SIMPLE-Co-Sales-Agent is an example of an agent that uses these tools to book demos.
| Tool Name | Description | Agent Config Source |
|---|---|---|
calcom_get_available_slots | Check available times for demos. | agent_configs/SIMPLE-Co-Sales-Agent.json:71 |
calcom_create_booking | Book a demo directly (requires name, email, and selected time). | agent_configs/SIMPLE-Co-Sales-Agent.json:72 |
calcom_get_all_bookings | View existing bookings. | agent_configs/SIMPLE-Co-Sales-Agent.json:73 |
calcom_get_booking | Get details of a specific booking. | agent_configs/SIMPLE-Co-Sales-Agent.json:74 |
calcom_cancel_booking | Cancel an existing booking. | agent_configs/SIMPLE-Co-Sales-Agent.json:75 |
These tools are defined as api_integration_webhook type, pointing to the calcom API integration.
// agent_configs/SIMPLE-Co-Sales-Agent.json:191-210
{
"type": "api_integration_webhook",
"name": "calcom_create_booking",
"description": "Create a new booking for an event. This schedules an appointment.",
"response_timeout_secs": 20,
"disable_interruptions": false,
"force_pre_tool_speech": false,
"assignments": [],
"tool_call_sound": null,
"tool_call_sound_behavior": "auto",
"dynamic_variables": {
"dynamic_variable_placeholders": {}
},
"execution_mode": "immediate",
"tool_version": "1.0.0",
"api_integration_id": "calcom",
"api_integration_connection_id": "icxn_6101kcppvzk9fv59xn4chmm3mv5v",
"api_schema_overrides": null
}
Sources: agent_configs/SIMPLE-Co-Sales-Agent.json:70-75, agent_configs/SIMPLE-Co-Sales-Agent.json:191-210
Summary
The AI agent tools are a fundamental part of the TalkCRM architecture, providing the necessary functions for the voice AI to perform meaningful actions on behalf of the user. By defining a clear set of tools in the agent's prompt and implementing the corresponding logic in the backend, TalkCRM can effectively translate conversational language into specific CRM operations, enabling a hands-free, voice-driven workflow for sales representatives.
Sources: README.md:33-34, PROJECT_DESCRIPTION.md:19-27