Skip to main content
Glama
voiceAgent.ts1.28 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { createToolHandler, getAuthToken } from "../utils.js"; import { JustCallApiService } from "../../sdk/justcall.js"; import { ListVoiceAgentsSchema, InitiateVoiceAgentCallSchema, } from "../../schema/index.js"; export const registerVoiceAgentTools = (server: McpServer) => { const justcallAPIservice = new JustCallApiService(); // List Voice Agents Tool server.tool( "list_voice_agents", "Retrieve all AI voice agents associated with the JustCall account", ListVoiceAgentsSchema, { readOnlyHint: true, }, createToolHandler(async (params, context) => { const authToken = getAuthToken(context); return justcallAPIservice.listVoiceAgents({ authToken, context, ...params, }); }), ); // Initiate Voice Agent Call Tool server.tool( "create_voice_agent_call", "Initiate an outbound call from a configured AI voice agent to a contact number", InitiateVoiceAgentCallSchema, createToolHandler(async (params, context) => { const authToken = getAuthToken(context); return justcallAPIservice.initiateVoiceAgentCall({ authToken, context, ...params, }); }), ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/saaslabsco/justcall-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server