Skip to main content
Glama

list_phone_numbers

Read-onlyIdempotent

View your phone number inventory with current status and configuration details to manage and monitor your BubblyPhone telephony assets.

Instructions

List your owned phone numbers with their status and configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'list_phone_numbers' tool with the MCP server. Defines the tool name, description, empty input schema, read-only annotations, and the handler function.
    server.registerTool(
      "list_phone_numbers",
      {
        description: "List your owned phone numbers with their status and configuration.",
        inputSchema: {},
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      },
      async () => callTool(() => client.get("/phone-numbers"))
    );
  • The handler function for 'list_phone_numbers' that executes the tool logic. Makes a GET request to the /phone-numbers endpoint via the client and wraps it with the callTool helper for error handling.
    async () => callTool(() => client.get("/phone-numbers"))
  • Helper function 'callTool' that wraps API calls with standardized error handling. Catches ApiError exceptions and formats them as tool errors, while successful responses are formatted as JSON tool results.
    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 containing function 'registerPhoneNumberTools' that registers all phone number related tools including 'list_phone_numbers'. Shows the pattern of how tools are registered with the MCP server.
    export function registerPhoneNumberTools(server: McpServer, client: BubblyPhoneClient) {
      server.registerTool(
        "search_phone_numbers",
        {
          description:
            "Search for available phone numbers to purchase. Filter by country, area code, or locality. " +
            "Returns numbers with pricing information.",
          inputSchema: {
            country_code: z.string().length(2).optional().describe("Two-letter country code (default: US)"),
            area_code: z.string().optional().describe("Area code to filter by"),
            locality: z.string().optional().describe("City or locality name"),
            number_type: z.enum(["local", "mobile", "toll_free", "national"]).optional().describe("Type of number (default: local)"),
            contains: z.string().optional().describe("Search for numbers containing this string"),
            limit: z.number().min(1).max(50).optional().describe("Max results (default: 20, max: 50)"),
          },
          annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
        },
        async (params) => {
          const query: Record<string, string> = {};
          if (params.country_code) query.country = params.country_code;
          if (params.area_code) query.area_code = params.area_code;
          if (params.locality) query.locality = params.locality;
          if (params.number_type) query.number_type = params.number_type;
          if (params.contains) query.contains = params.contains;
          if (params.limit) query.limit = String(params.limit);
          return callTool(() => client.get("/phone-numbers/available", query));
        }
      );
  • src/server.ts:21-21 (registration)
    The call site where registerPhoneNumberTools is invoked during server initialization, connecting the phone number tools (including list_phone_numbers) to the MCP server instance.
    registerPhoneNumberTools(server, client);
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds valuable behavioral context by specifying that the listing includes 'status and configuration' data, informing the agent what attributes are returned without contradicting the safety annotations.

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 sentence of 9 words with zero redundancy. Information is front-loaded with the action verb, and every word ('owned', 'status', 'configuration') earns its place by adding semantic value.

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?

No output schema exists, so the description carries the burden of explaining return values. It partially satisfies this by mentioning 'status and configuration' fields, though it could explicitly confirm the return structure is a list/collection. Adequate for a zero-parameter read operation with good annotations.

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?

Input schema contains zero parameters, establishing a baseline of 4. The description appropriately requires no parameter clarification since no arguments are needed to invoke this tool.

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?

Specific verb 'List' + resource 'owned phone numbers' + scope 'status and configuration'. The term 'owned' effectively distinguishes from sibling 'search_phone_numbers' (which finds available numbers) and 'get_phone_number' (which retrieves a specific number).

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

Usage Guidelines4/5

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

The word 'owned' provides clear contextual guidance that this tool is for viewing existing inventory rather than acquiring new numbers (buy_phone_number) or searching available inventory (search_phone_numbers). However, it does not explicitly name alternatives or state when-not-to-use conditions.

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