Skip to main content
Glama
gcorroto

Asterisk S2S MCP Server

by gcorroto

phone_make_call

Initiate automated phone calls with conversational capabilities using the Asterisk S2S MCP Server. Specify user, phone number, purpose, and additional context to streamline communications.

Instructions

Realizar una llamada telefónica conversacional automatizada

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextoNoContexto adicional sobre el tema a tratar
herramientas_personalizadasNoHerramientas HTTP personalizadas en formato JSON
propositoYesPropósito específico de la llamada
telefonoYesNúmero de teléfono del usuario
timeoutNoTimeout de la llamada en segundos
usuarioYesNombre del usuario a llamar

Implementation Reference

  • Core handler function that executes the phone call logic: logs the initiation, calls the PhoneClient to make the call, manages active calls state, and handles errors.
    export async function makePhoneCall(request: PhoneCallRequest): Promise<{
      success: boolean;
      callId: string;
      message: string;
      estimatedDuration?: number;
    }> {
      const client = getPhoneClient();
      
      try {
        // Log de la invocación
        const log: SystemLog = {
          id: generateId(),
          timestamp: new Date().toISOString(),
          level: 'info',
          component: 'phone',
          action: 'initiate_call',
          details: {
            usuario: request.usuario,
            telefono: request.telefono,
            proposito: request.proposito,
            timeout: request.timeout,
            herramientasCount: request.herramientas.length
          }
        };
        systemLogs.push(log);
    
        // Invocar asistente telefónico
        const response = await client.makePhoneCall(request);
        
        // Registrar llamada activa
        const callStatus: CallStatus = {
          callId: response.callId,
          status: 'pending',
          startTime: new Date().toISOString(),
          lastUpdate: new Date().toISOString(),
          usuario: request.usuario,
          telefono: request.telefono,
          proposito: request.proposito
        };
        
        activeCalls.set(response.callId, callStatus);
        
        return response;
      } catch (error) {
        // Log del error
        const errorLog: SystemLog = {
          id: generateId(),
          timestamp: new Date().toISOString(),
          level: 'error',
          component: 'phone',
          action: 'initiate_call_failed',
          details: {
            error: error instanceof Error ? error.message : 'Unknown error',
            usuario: request.usuario,
            proposito: request.proposito
          }
        };
        systemLogs.push(errorLog);
        
        throw error;
      }
    }
  • index.ts:22-49 (registration)
    MCP server tool registration for 'phone_make_call', including input schema with Zod and thin handler delegating to phoneTools.makePhoneCall.
      "phone_make_call",
      "Realizar una llamada telefónica conversacional automatizada",
      {
        usuario: z.string().describe("Nombre del usuario a llamar"),
        telefono: z.string().describe("Número de teléfono del usuario"),
        proposito: z.string().describe("Propósito específico de la llamada"),
        contexto: z.string().optional().describe("Contexto adicional sobre el tema a tratar"),
        timeout: z.number().optional().default(40).describe("Timeout de la llamada en segundos"),
        herramientas_personalizadas: z.string().optional().describe("Herramientas HTTP personalizadas en formato JSON")
      },
      async (args) => {
        const result = await phoneTools.makePhoneCall({
          usuario: args.usuario,
          telefono: args.telefono,
          proposito: args.proposito,
          contexto: args.contexto,
          timeout: args.timeout || 40,
          herramientas_personalizadas: args.herramientas_personalizadas
        });
    
        return {
          content: [{ 
            type: "text", 
            text: `📞 Llamada iniciada con ${args.usuario}\n\n**ID de llamada:** ${result.callId}\n**Mensaje:** ${result.message}\n**Duración estimada:** ${result.estimatedDuration || 'No estimada'} segundos`
          }],
        };
      }
    );
  • TypeScript interface defining the input schema for phone call requests (PhoneCallRequest).
    export interface PhoneCallRequest {
      usuario: string;
      telefono: string;
      timeout: number;
      proposito: string; // Para qué es la llamada
      contexto?: string; // Contexto adicional sobre el tema
      herramientas: HttpTool[]; // Tools que puede usar el asistente telefónico
    }
  • Wrapper helper function that processes input arguments, adds default tools, parses custom tools, and delegates to phoneOps.makePhoneCall.
    export async function makePhoneCall(args: {
      usuario: string;
      telefono: string;
      proposito: string;
      contexto?: string;
      timeout?: number;
      herramientas_personalizadas?: string; // JSON string de herramientas adicionales
    }): Promise<{
      success: boolean;
      callId: string;
      message: string;
      estimatedDuration?: number;
    }> {
      const { usuario, telefono, proposito, contexto, herramientas_personalizadas } = args;
      const timeout = args.timeout || 40;
    
      // Parsear herramientas personalizadas si se proporcionan
      let herramientasPersonalizadas: HttpTool[] = [];
      if (herramientas_personalizadas) {
        try {
          herramientasPersonalizadas = JSON.parse(herramientas_personalizadas);
        } catch (error) {
          throw new Error(`Error al parsear herramientas personalizadas: ${error instanceof Error ? error.message : 'JSON inválido'}`);
        }
      }
    
      // Herramientas básicas conversacionales (mínimas)
      const herramientasBasicas: HttpTool[] = [
        // Herramienta para confirmar información obtenida
        {
          name: 'confirmar_informacion',
          description: 'Confirma información importante obtenida durante la conversación',
          endpoint: `${process.env.MCP_CALLBACK_URL || 'http://localhost:3000'}/api/phone/confirm-info`,
          method: 'POST',
          parameters: [
            {
              name: 'callId',
              type: 'string',
              description: 'ID de la llamada',
              required: true
            },
            {
              name: 'tipo_informacion',
              type: 'string',
              description: 'Tipo de información (contacto, cita, preferencia, etc.)',
              required: true
            },
            {
              name: 'datos',
              type: 'string',
              description: 'Datos confirmados en formato JSON',
              required: true
            },
            {
              name: 'usuario_confirmo',
              type: 'boolean',
              description: 'Si el usuario confirmó explícitamente',
              required: true
            }
          ],
          authentication: {
            type: 'api_key',
            header: 'X-MCP-API-Key',
            key: process.env.MCP_CALLBACK_API_KEY || 'mcp-default-key'
          }
        }
      ];
    
      // Combinar herramientas básicas con personalizadas
      const todasLasHerramientas = [...herramientasBasicas, ...herramientasPersonalizadas];
    
      // Construir request para el asistente telefónico
      const request: PhoneCallRequest = {
        usuario,
        telefono,
        timeout,
        proposito,
        contexto,
        herramientas: todasLasHerramientas
      };
    
      // Realizar llamada telefónica
      return await phoneOps.makePhoneCall(request);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the call is 'conversacional automatizada' (automated conversational), hinting at AI-driven interaction, but fails to disclose critical traits: whether this is a read/write operation (likely write, as it initiates calls), authentication needs, rate limits, error handling, or what happens on timeout (though timeout is a parameter). For a tool with no annotations and potential side effects, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that directly states the tool's purpose without fluff. It's appropriately sized and front-loaded, with every word contributing to understanding the core function. No unnecessary details or repetition are present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an automated phone call tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., side effects, error handling), return values (since no output schema exists), and usage context. For a tool that likely involves external interactions and mutations, this leaves the agent under-informed about critical operational aspects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 6 parameters (e.g., 'telefono' as phone number, 'proposito' as call purpose). The description adds no additional meaning beyond what's in the schema—it doesn't explain parameter interactions, default behaviors, or usage examples. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'Realizar una llamada telefónica conversacional automatizada' (Make an automated conversational phone call), which is a specific verb+resource combination. It distinguishes this from siblings like phone_cancel_call or phone_get_active_calls by focusing on initiating calls rather than managing or retrieving information about them. However, it doesn't explicitly differentiate from all siblings (e.g., it could be more specific about automated vs. manual calls).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether the system must be configured first), when not to use it (e.g., for non-conversational calls), or direct alternatives among the siblings. The agent must infer usage from the purpose alone, which is insufficient for clear decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/gcorroto/mcp-s2s-asterisk'

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