Skip to main content
Glama

list_calls

Read-onlyIdempotent

Retrieve call history with filters for direction, status, phone number, and date range to track communications and analyze outcomes.

Instructions

List your calls with optional filtering by direction, status, phone number, and date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionNoFilter by call direction
statusNoFilter by call status
phone_number_idNoFilter by phone number ID
date_fromNoStart date filter (YYYY-MM-DD)
date_toNoEnd date filter (YYYY-MM-DD)

Implementation Reference

  • The handler function for list_calls tool that builds a query object from optional filters (direction, status, phone_number_id, date_from, date_to) and calls client.get('/calls', query)
    async (params) => {
      const query: Record<string, string> = {};
      if (params.direction) query.direction = params.direction;
      if (params.status) query.status = params.status;
      if (params.phone_number_id) query.phone_number_id = params.phone_number_id;
      if (params.date_from) query.date_from = params.date_from;
      if (params.date_to) query.date_to = params.date_to;
      return callTool(() => client.get("/calls", query));
    }
  • The schema definition for list_calls including description, input schema with Zod validation for direction, status, phone_number_id, date_from, date_to filters, and read-only annotations
    {
      description: "List your calls with optional filtering by direction, status, phone number, and date range.",
      inputSchema: {
        direction: z.enum(["inbound", "outbound"]).optional().describe("Filter by call direction"),
        status: z.enum(["initiated", "ringing", "answered", "completed", "failed"]).optional().describe("Filter by call status"),
        phone_number_id: z.string().optional().describe("Filter by phone number ID"),
        date_from: z.string().optional().describe("Start date filter (YYYY-MM-DD)"),
        date_to: z.string().optional().describe("End date filter (YYYY-MM-DD)"),
      },
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
    },
  • The registration of the list_calls tool with server.registerTool(), combining the tool name, schema configuration, and handler function
    server.registerTool(
      "list_calls",
      {
        description: "List your calls with optional filtering by direction, status, phone number, and date range.",
        inputSchema: {
          direction: z.enum(["inbound", "outbound"]).optional().describe("Filter by call direction"),
          status: z.enum(["initiated", "ringing", "answered", "completed", "failed"]).optional().describe("Filter by call status"),
          phone_number_id: z.string().optional().describe("Filter by phone number ID"),
          date_from: z.string().optional().describe("Start date filter (YYYY-MM-DD)"),
          date_to: z.string().optional().describe("End date filter (YYYY-MM-DD)"),
        },
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      },
      async (params) => {
        const query: Record<string, string> = {};
        if (params.direction) query.direction = params.direction;
        if (params.status) query.status = params.status;
        if (params.phone_number_id) query.phone_number_id = params.phone_number_id;
        if (params.date_from) query.date_from = params.date_from;
        if (params.date_to) query.date_to = params.date_to;
        return callTool(() => client.get("/calls", query));
      }
    );
  • Helper function callTool that wraps API calls with try-catch error handling, returning toolResult on success or toolError on API failure
    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}`);
      }
    }
  • The registerCallTools function signature which contains all call-related tool registrations including list_calls
    export function registerCallTools(server: McpServer, client: BubblyPhoneClient) {
      server.registerTool(
Behavior3/5

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

Annotations already establish read-only, non-destructive, idempotent safety. The description adds scope ('your calls') and filtering context but omits pagination behavior, default sorting, result limits, or whether deleted calls are included.

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?

Single front-loaded sentence (12 words) with zero redundancy. Core action ('List your calls') precedes modifiers ('with optional filtering...'), making it immediately scannable.

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?

Adequate for a list operation given rich annotations and complete parameter schema. However, lacking an output schema, it could benefit from noting whether results are paginated or if there's a maximum return limit.

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 coverage, baseline is met. The description categorizes filters (direction, status, phone number, date range) providing a useful overview, but adds no semantic depth beyond the schema's individual parameter descriptions (e.g., no format examples or dependency notes).

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?

States specific verb 'List' and resource 'calls' clearly, and notes filtering capabilities. However, it does not explicitly distinguish from sibling 'get_call' (singular retrieval) vs this list operation, which could cause selection ambiguity.

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?

Mentions 'optional filtering' implying parameters are not required, but provides no explicit guidance on when to use this tool versus 'get_call' for single-call retrieval, nor any prerequisites or performance considerations.

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