Skip to main content
Glama
gcorroto

Asterisk S2S MCP Server

by gcorroto

phone_get_status

Retrieve the current status of a phone call by providing the call ID using Asterisk S2S MCP Server's functionality for automated conversational calls.

Instructions

Obtener el estado actual de una llamada telefónica

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
callIdYesID de la llamada

Implementation Reference

  • index.ts:52-74 (registration)
    MCP tool registration for 'phone_get_status', including input schema, description, and handler function that delegates to phoneTools.getCallStatus and formats the response.
    server.tool(
      "phone_get_status",
      "Obtener el estado actual de una llamada telefónica",
      {
        callId: z.string().describe("ID de la llamada")
      },
      async (args) => {
        const result = await phoneTools.getCallStatus({ callId: args.callId });
        
        if (!result) {
          return {
            content: [{ type: "text", text: `❌ No se encontró la llamada con ID: ${args.callId}` }],
          };
        }
    
        return {
          content: [{ 
            type: "text", 
            text: `📊 **Estado de llamada ${args.callId}**\n\n**Usuario:** ${result.usuario}\n**Teléfono:** ${result.telefono}\n**Estado:** ${result.status}\n**Propósito:** ${result.proposito}\n**Duración:** ${result.duration || 'N/A'} segundos\n**Última actualización:** ${result.lastUpdate}`
          }],
        };
      }
    );
  • Input schema for phone_get_status tool using Zod: requires callId string.
    {
      callId: z.string().describe("ID de la llamada")
    },
  • index.ts:58-73 (handler)
    Handler function for phone_get_status MCP tool: calls phoneTools.getCallStatus, handles null result, formats status information into MCP content response.
    async (args) => {
      const result = await phoneTools.getCallStatus({ callId: args.callId });
      
      if (!result) {
        return {
          content: [{ type: "text", text: `❌ No se encontró la llamada con ID: ${args.callId}` }],
        };
      }
    
      return {
        content: [{ 
          type: "text", 
          text: `📊 **Estado de llamada ${args.callId}**\n\n**Usuario:** ${result.usuario}\n**Teléfono:** ${result.telefono}\n**Estado:** ${result.status}\n**Propósito:** ${result.proposito}\n**Duración:** ${result.duration || 'N/A'} segundos\n**Última actualización:** ${result.lastUpdate}`
        }],
      };
    }
  • Helper function getCallStatus in tools layer: wraps phoneOps.getCallStatus and returns formatted status object or null.
    export async function getCallStatus(args: {
      callId: string;
    }): Promise<{
      status: string;
      duration?: number;
      lastUpdate: string;
      usuario: string;
      telefono: string;
      proposito: string;
    } | null> {
      const { callId } = args;
      
      const status = await phoneOps.getCallStatus(callId);
      
      if (!status) {
        return null;
      }
    
      return {
        status: status.status,
        duration: status.duration,
        lastUpdate: status.lastUpdate,
        usuario: status.usuario,
        telefono: status.telefono,
        proposito: status.proposito
      };
    }
  • Operations layer getCallStatus: checks local activeCalls map, fetches from remote client.getCallStatus, updates local state, falls back to local on error.
    export async function getCallStatus(callId: string): Promise<CallStatus | null> {
      // Primero verificar en el estado local
      const localStatus = activeCalls.get(callId);
      
      if (!localStatus) {
        return null;
      }
      
      try {
        // Obtener estado actualizado del asistente
        const client = getPhoneClient();
        const remoteStatus = await client.getCallStatus(callId);
        
        // Actualizar estado local
        activeCalls.set(callId, remoteStatus);
        
        return remoteStatus;
      } catch (error) {
        console.warn(`No se pudo obtener estado remoto para ${callId}, usando estado local`);
        return localStatus;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Obtener el estado actual' implies a read-only operation, it doesn't specify what 'estado' includes (e.g., ringing, connected, ended), whether permissions are required, or what format the status returns. For a tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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, focused sentence that directly states the tool's purpose without any unnecessary words. It's perfectly front-loaded and wastes no space on redundant information.

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 lack of annotations and output schema, the description should provide more complete context about what 'estado' means and what information is returned. For a status-checking tool that likely returns structured data about call state, the current description is insufficient to understand what the agent will receive as output.

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?

The schema description coverage is 100%, with the single parameter 'callId' clearly documented as 'ID de la llamada'. The description doesn't add any additional parameter context beyond what the schema provides, but with complete schema coverage, the baseline score of 3 is appropriate.

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 action ('Obtener el estado actual') and resource ('una llamada telefónica'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'phone_get_active_calls' or 'phone_get_last_result', which also retrieve call-related information.

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. With siblings like 'phone_get_active_calls' (likely listing multiple calls) and 'phone_get_last_result' (likely retrieving a specific outcome), there's no indication of when this status-checking tool is appropriate versus those other options.

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