Skip to main content
Glama

hangup_call

DestructiveIdempotent

Terminate active phone calls immediately using the call ID. Ends ongoing conversations in the BubblyPhone telephony system to disconnect callers.

Instructions

Terminate an active call immediately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
call_idYesThe call ID to hang up

Implementation Reference

  • The handler function that executes the hangup_call tool logic - makes a POST request to /calls/{call_id}/hangup endpoint
    async (params) => callTool(() => client.post(`/calls/${params.call_id}/hangup`))
  • Input schema validation for hangup_call - requires a call_id string parameter
    inputSchema: {
      call_id: z.string().describe("The call ID to hang up"),
    },
  • Registration of the hangup_call tool with the MCP server, including name, description, schema, annotations, and handler
    server.registerTool(
      "hangup_call",
      {
        description: "Terminate an active call immediately.",
        inputSchema: {
          call_id: z.string().describe("The call ID to hang up"),
        },
        annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
      },
      async (params) => callTool(() => client.post(`/calls/${params.call_id}/hangup`))
    );
  • Helper function that wraps tool execution with error handling - catches ApiError and returns formatted error response
    async function callTool<T>(fn: () => Promise<T>) {
      try {
        return toolResult(await fn());
      } catch (err) {
        const apiErr = err as ApiError;
        return toolError(`API error (${apiErr.status}): ${apiErr.message}`);
      }
    }
  • BubblyPhoneClient.post method - makes authenticated POST HTTP requests to the API
    async post<T = unknown>(path: string, body?: Record<string, unknown>): Promise<T> {
      return this.request<T>(`${this.baseUrl}${path}`, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: body ? JSON.stringify(body) : undefined,
      });
    }
Behavior3/5

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

The word 'immediately' adds valuable timing context beyond what the annotations provide, indicating the action occurs without delay. However, given the annotations already cover the destructive and idempotent nature of the operation, the description could have added more about side effects (e.g., whether the call record is preserved or marked as 'completed').

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 single-sentence description is exceptionally concise with zero redundant words. It front-loads the critical action verb and efficiently communicates both the target resource and execution speed.

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

Completeness4/5

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

For a single-parameter destructive operation with complete schema coverage and comprehensive annotations, the description is appropriately complete. It could marginally improve by clarifying the terminal state of the call after hangup, but this is not required given the tool's simplicity.

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?

With 100% schema description coverage, the input schema already fully documents the 'call_id' parameter. The description does not add additional semantic meaning about the parameter format or constraints, meeting the baseline expectation for high-coverage schemas.

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

Purpose5/5

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

The description uses a specific verb ('Terminate') and resource ('active call') that clearly distinguishes this tool from siblings like 'transfer_call' (which moves calls) and 'make_call' (which creates them). It precisely conveys the core action of ending a call session.

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

Usage Guidelines3/5

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

The phrase 'active call' implies this should only be used when a call is in progress, but there is no explicit guidance on when to choose this over 'transfer_call' or other alternatives. It lacks prerequisites or 'when-not-to-use' exclusions that would help an agent avoid hanging up calls that should be transferred instead.

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

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/JobXDubai/mcp-server'

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