Skip to main content
Glama
gcorroto

Asterisk S2S MCP Server

by gcorroto

phone_get_active_calls

Retrieve a real-time list of active phone calls on the Asterisk S2S MCP Server for monitoring or managing ongoing conversations efficiently.

Instructions

Obtener lista de llamadas telefónicas activas en este momento

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:144-168 (registration)
    MCP server tool registration for 'phone_get_active_calls'. Defines description, empty input schema, and thin async handler that calls phoneTools.getActiveCalls() and formats response as text.
    server.tool(
      "phone_get_active_calls",
      "Obtener lista de llamadas telefónicas activas en este momento",
      {},
      async () => {
        const result = await phoneTools.getActiveCalls();
    
        if (result.length === 0) {
          return {
            content: [{ type: "text", text: "📵 No hay llamadas activas en este momento" }],
          };
        }
    
        const activeText = result.map(call => 
          `**${call.callId}** - ${call.usuario} (${call.telefono})\n📞 Estado: ${call.status}\n🎯 Propósito: ${call.proposito}\n⏱️ Iniciada: ${call.startTime || 'N/A'}`
        ).join('\n\n');
    
        return {
          content: [{ 
            type: "text", 
            text: `📞 **Llamadas Activas (${result.length})**\n\n${activeText}`
          }],
        };
      }
    );
  • Async wrapper function getActiveCalls() that delegates to phoneOps.getActiveCalls() and maps the CallStatus objects to a simplified response structure including duration.
    export async function getActiveCalls(): Promise<Array<{
      callId: string;
      status: string;
      usuario: string;
      telefono: string;
      proposito: string;
      startTime?: string;
      duration?: number;
    }>> {
      return phoneOps.getActiveCalls().map(call => ({
        callId: call.callId,
        status: call.status,
        usuario: call.usuario,
        telefono: call.telefono,
        proposito: call.proposito,
        startTime: call.startTime,
        duration: call.duration
      }));
    }
  • Core implementation of getActiveCalls(): Returns all active calls from the in-memory activeCalls Map.
    export function getActiveCalls(): CallStatus[] {
      return Array.from(activeCalls.values());
    }
  • In-memory Map storing active CallStatus objects, populated during makePhoneCall and updated in other operations.
    const activeCalls = new Map<string, CallStatus>();
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. The description only states what the tool does (get active calls) but doesn't reveal important behavioral traits: whether this is a real-time query, if it requires specific permissions, what format the returned data has, if there are rate limits, or how 'active' is defined (e.g., in-progress vs. recently completed). For a tool with zero annotation coverage, this is inadequate.

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, clear sentence that efficiently communicates the tool's purpose. It's appropriately sized for a simple tool with no parameters. Every word earns its place - there's no redundancy or unnecessary elaboration.

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 that this is a data retrieval tool with no annotations, no output schema, and no parameters, the description is incomplete. It doesn't explain what 'active' means, what data fields are returned, whether this is real-time or cached data, or any error conditions. For a tool that presumably returns structured call data, the description should provide more context about the return format and behavioral characteristics.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain any parameters, and it correctly doesn't mention any. Since there are no parameters to document, the description appropriately focuses on the tool's purpose rather than parameter semantics.

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: 'Obtener lista de llamadas telefónicas activas en este momento' (Get list of active phone calls at this moment). It specifies the verb ('obtener' - get) and resource ('llamadas telefónicas activas' - active phone calls), but doesn't explicitly differentiate it from sibling tools like phone_get_conversation_history or phone_get_logs, 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. It doesn't mention when this tool is appropriate (e.g., for real-time monitoring) versus when to use siblings like phone_get_conversation_history (for past calls) or phone_get_logs (for detailed records). The description is a simple statement of purpose without contextual usage information.

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