Skip to main content
Glama

Buy a phone number

acquire_number
DestructiveIdempotent

Buy a quoted phone number with explicit price confirmation.

    This charges the setup fee and first month immediately, then renews monthly.
    The purchase requires the user's authorization for that number and cost.
    Expired or changed offers return 409 without authorizing a different price.
    Each quote can buy at most one number.

    A retry with the same quote and ``idempotency_key`` refers to the original purchase.
    After a timeout, a new quote starts a different purchase and can buy a second number.
    A returned retry key is available after a timeout or server error.
    A 4xx failure returns no retry key; that failed request cannot be reused.
    A rejected or ambiguous registration selection returns 422.
    A purchase does not assign an answering agent automatically.
    Returns the number record and ``idempotency_key``, or an error with any available retry key.
    

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "quote_id": "<quote_id>",
      "country_code": "<country_code>",
      "number_type": "<number_type>",
      "confirm_total_cents": "<confirm_total_cents>"
    },
    "name": "acquire_number"
  }
}

Input Schema

NameRequiredDescriptionDefault
quote_idYes``quote_id`` of one offer from ``quote_numbers``.
llm_modelNoThe calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics.
number_typeYesKind of number being bought: copy the offer's ``number_type`` from ``quote_numbers``. Hail checks it against the offer.
country_codeYesCountry of the number being bought, as an ISO alpha-2 code: the ``country_code`` sent to ``quote_numbers`` for this offer.
subject_typeNoWhose approved registration may be used: the user's own (``person``) or their company's (``business``). Omitted: either.
idempotency_keyNoRetry key. The ``idempotency_key`` from an earlier response refers to that original request instead of starting a new one. Omitted: a new key is generated and returned.
verification_idNoWhich approved registration covers this purchase: an ``id`` from the offer's ``verifications``. Give it when the offer lists more than one approved registration. Omitted: the only approved one, if any.
confirm_total_centsYesThe offer's ``setup_cents`` plus ``monthly_cents``, in USD cents, as the user authorized it.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "capabilities": {
      -        "description": "Channels this number supports, e.g. ['voice'], ['sms'], or both.",
      -        "items": {
      -          "type": "string"
      -        },
      -        "title": "Capabilities",
      -        "type": "array"
      -      },
      -      "country_code": {
      -        "description": "ISO alpha-2 country code this number belongs to.",
      -        "title": "Country Code",
      -        "type": "string"
      -      },
      -      "e164": {
      -        "description": "The phone number, E.164 format.",
      -        "title": "E164",
      -        "type": "string"
      -      },
      -      "id": {
      -        "description": "Unique identifier for this number.",
      -        "format": "uuid",
      -        "title": "Id",
      -        "type": "string"
      -      },
      -      "idempotency_key": {
      -        "description": "Key that identifies this exact request when retrying.",
      -        "type": "string"
      -      },
      -      "inbound_registered": {
      -        "default": false,
      -        "description": "True while the number is attached for inbound calls at the carrier and on Hail's LiveKit inbound trunk. Set when voice_agent_id is set.",
      -        "title": "Inbound Registered",
      -        "type": "boolean"
      -      },
      -      "is_dedicated": {
      -        "description": "True if this number is owned by the organization. False for shared-pool numbers.",
      -        "title": "Is Dedicated",
      -        "type": "boolean"
      -      },
      -      "number_type": {
      -        "description": "Kind of number: 'local', 'mobile', 'toll_free', or 'national'.",
      -        "title": "Number Type",
      -        "type": "string"
      -      },
      -      "provisioning_state": {
      -        "description": "'pending', 'active', 'failed', or 'released'.",
      -        "title": "Provisioning State",
      -        "type": "string"
      -      },
      -      "sms_agent_id": {
      -        "anyOf": [
      -          {
      -            "format": "uuid",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Agent that answers texts to this number. Null: texts only reach your webhooks.",
      -        "title": "Sms Agent Id"
      -      },
      -      "subject_name": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Name of the person or company the verification used to buy this number is for. Null when no verification was used or the name is unknown.",
      -        "title": "Subject Name"
      -      },
      -      "subject_type": {
      -        "anyOf": [
      -          {
      -            "enum": [
      -              "person",
      -              "business"
      -            ],
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Who the verification used to buy this number is for: 'person' or 'business'. Null when no verification was used.",
      -        "title": "Subject Type"
      -      },
      -      "verification_id": {
      -        "anyOf": [
      -          {
      -            "format": "uuid",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Hail id of the verification used to buy this number. Null when no verification was used.",
      -        "title": "Verification Id"
      -      },
      -      "voice_agent_id": {
      -        "anyOf": [
      -          {
      -            "format": "uuid",
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Agent that answers calls to this number. Null: calls ring out.",
      -        "title": "Voice Agent Id"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "e164",
      -      "country_code",
      -      "number_type",
      -      "capabilities",
      -      "provisioning_state",
      -      "is_dedicated",
      -      "voice_agent_id",
      -      "sms_agent_id",
      -      "inbound_registered",
      -      "subject_type",
      -      "verification_id",
      -      "subject_name",
      -      "idempotency_key"
      -    ],
      -    "title": "PhoneNumberResponse",
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "type": "string"
      -      },
      -      "idempotency_key": {
      -        "description": "Key that identifies this exact request when retrying.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "capabilities": {
      +        "description": "Channels this number supports, e.g. ['voice'], ['sms'], or both.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "title": "Capabilities",
      +        "type": "array"
      +      },
      +      "country_code": {
      +        "description": "ISO alpha-2 country code this number belongs to.",
      +        "title": "Country Code",
      +        "type": "string"
      +      },
      +      "e164": {
      +        "description": "The phone number, E.164 format.",
      +        "title": "E164",
      +        "type": "string"
      +      },
      +      "id": {
      +        "description": "Unique identifier for this number.",
      +        "format": "uuid",
      +        "title": "Id",
      +        "type": "string"
      +      },
      +      "idempotency_key": {
      +        "description": "Key that identifies this exact request when retrying.",
      +        "type": "string"
      +      },
      +      "inbound_registered": {
      +        "default": false,
      +        "description": "True while the number is attached for inbound calls at the carrier and on Hail's LiveKit inbound trunk. Set when voice_agent_id is set.",
      +        "title": "Inbound Registered",
      +        "type": "boolean"
      +      },
      +      "is_dedicated": {
      +        "description": "True if this number is owned by the organization. False for shared-pool numbers.",
      +        "title": "Is Dedicated",
      +        "type": "boolean"
      +      },
      +      "number_type": {
      +        "description": "Kind of number: 'local', 'mobile', 'toll_free', or 'national'.",
      +        "title": "Number Type",
      +        "type": "string"
      +      },
      +      "provisioning_state": {
      +        "description": "'pending', 'active', 'failed', or 'released'. A connected number is 'unverified' until it passes its ownership check (POST /sip-connections/{id}/numbers/{number_id}/verify).",
      +        "title": "Provisioning State",
      +        "type": "string"
      +      },
      +      "sip_connection_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "The phone system connection of a connected number. Null for a purchased number.",
      +        "title": "Sip Connection Id"
      +      },
      +      "sms_agent_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Agent that answers texts to this number. Null: texts only reach your webhooks.",
      +        "title": "Sms Agent Id"
      +      },
      +      "source": {
      +        "default": "purchased",
      +        "description": "'purchased': bought through Hail. 'connected': a number on your own phone system, connected with POST /sip-connections/{id}/numbers. Removing a connected number takes it off Hail only; it stays with your phone system and provider.",
      +        "enum": [
      +          "purchased",
      +          "connected"
      +        ],
      +        "title": "Source",
      +        "type": "string"
      +      },
      +      "subject_name": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Name of the person or company the verification used to buy this number is for. Null when no verification was used or the name is unknown.",
      +        "title": "Subject Name"
      +      },
      +      "subject_type": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "person",
      +              "business"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Who the verification used to buy this number is for: 'person' or 'business'. Null when no verification was used.",
      +        "title": "Subject Type"
      +      },
      +      "verification_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Hail id of the verification used to buy this number. Null when no verification was used.",
      +        "title": "Verification Id"
      +      },
      +      "voice_agent_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Agent that answers calls to this number. Null: calls ring out.",
      +        "title": "Voice Agent Id"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "e164",
      +      "country_code",
      +      "number_type",
      +      "capabilities",
      +      "provisioning_state",
      +      "source",
      +      "sip_connection_id",
      +      "is_dedicated",
      +      "voice_agent_id",
      +      "sms_agent_id",
      +      "inbound_registered",
      +      "subject_type",
      +      "verification_id",
      +      "subject_name",
      +      "idempotency_key"
      +    ],
      +    "title": "PhoneNumberResponse",
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "type": "string"
      +      },
      +      "idempotency_key": {
      +        "description": "Key that identifies this exact request when retrying.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / llm_model / description
      Previous value: -"Model ID of the calling agent. Optional. Recorded for analytics only."New value: +"The calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics."
  3. Changed3 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "capabilities": {
      +        "description": "Channels this number supports, e.g. ['voice'], ['sms'], or both.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "title": "Capabilities",
      +        "type": "array"
      +      },
      +      "country_code": {
      +        "description": "ISO alpha-2 country code this number belongs to.",
      +        "title": "Country Code",
      +        "type": "string"
      +      },
      +      "e164": {
      +        "description": "The phone number, E.164 format.",
      +        "title": "E164",
      +        "type": "string"
      +      },
      +      "id": {
      +        "description": "Unique identifier for this number.",
      +        "format": "uuid",
      +        "title": "Id",
      +        "type": "string"
      +      },
      +      "idempotency_key": {
      +        "description": "Key that identifies this exact request when retrying.",
      +        "type": "string"
      +      },
      +      "inbound_registered": {
      +        "default": false,
      +        "description": "True while the number is attached for inbound calls at the carrier and on Hail's LiveKit inbound trunk. Set when voice_agent_id is set.",
      +        "title": "Inbound Registered",
      +        "type": "boolean"
      +      },
      +      "is_dedicated": {
      +        "description": "True if this number is owned by the organization. False for shared-pool numbers.",
      +        "title": "Is Dedicated",
      +        "type": "boolean"
      +      },
      +      "number_type": {
      +        "description": "Kind of number: 'local', 'mobile', 'toll_free', or 'national'.",
      +        "title": "Number Type",
      +        "type": "string"
      +      },
      +      "provisioning_state": {
      +        "description": "'pending', 'active', 'failed', or 'released'.",
      +        "title": "Provisioning State",
      +        "type": "string"
      +      },
      +      "sms_agent_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Agent that answers texts to this number. Null: texts only reach your webhooks.",
      +        "title": "Sms Agent Id"
      +      },
      +      "subject_name": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Name of the person or company the verification used to buy this number is for. Null when no verification was used or the name is unknown.",
      +        "title": "Subject Name"
      +      },
      +      "subject_type": {
      +        "anyOf": [
      +          {
      +            "enum": [
      +              "person",
      +              "business"
      +            ],
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Who the verification used to buy this number is for: 'person' or 'business'. Null when no verification was used.",
      +        "title": "Subject Type"
      +      },
      +      "verification_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Hail id of the verification used to buy this number. Null when no verification was used.",
      +        "title": "Verification Id"
      +      },
      +      "voice_agent_id": {
      +        "anyOf": [
      +          {
      +            "format": "uuid",
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Agent that answers calls to this number. Null: calls ring out.",
      +        "title": "Voice Agent Id"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "e164",
      +      "country_code",
      +      "number_type",
      +      "capabilities",
      +      "provisioning_state",
      +      "is_dedicated",
      +      "voice_agent_id",
      +      "sms_agent_id",
      +      "inbound_registered",
      +      "subject_type",
      +      "verification_id",
      +      "subject_name",
      +      "idempotency_key"
      +    ],
      +    "title": "PhoneNumberResponse",
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "type": "string"
      +      },
      +      "idempotency_key": {
      +        "description": "Key that identifies this exact request when retrying.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / title
      Removed value: -"acquire_number_toolDictOutput"
  4. Changed1 schema field changed
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Model ID of the calling agent. Optional. Recorded for analytics only.",
      +  "type": "string"
      +}
  5. Changed2 schema fields changed
    • changedInput schema / properties / verification_id / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "format": "uuid",
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / verification_id / description
      Previous value: -"Approved registration to use, from the offer's ``verifications``. Required when several approved registrations are eligible."New value: +"Which approved registration covers this purchase: an ``id`` from the offer's ``verifications``. Give it when the offer lists more than one approved registration. Omitted: the only approved one, if any."
  6. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses immediate charges for setup fee plus first month, monthly renewal, the user-authorization requirement, the one-number-per-quote cardinality limit, 409 on expired/changed offers without silently re-authorizing a different price, retry-key availability rules (returned after timeout/5xx, absent on 4xx), and that no answering agent is assigned. These are exactly the destructive/openWorld consequences the annotations flag but cannot explain.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and cost, then a well-organized block of error and retry behavior; every line is operational. Minor redundancy between the two idempotency paragraphs and an unstructured run of error-code sentences keep it from a 5.

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

Completeness5/5

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

For a destructive, money-charging, open-world purchase tool, it covers cost timing, authorization, error codes, retry/idempotency edge cases, and post-purchase state. An output schema exists, yet the description still summarizes the return value and retry key, which is a bonus rather than a requirement.

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?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: ``confirm_total_cents`` is framed as the user-authorized total, ``idempotency_key`` is framed as a retry handle tied to a previously returned key, and ``quote_id`` is constrained to a single offer that can be bought at most once. It says nothing about ``llm_model``, ``subject_type``, or ``verification_id``, relying on the schema for those.

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?

States a specific verb and resource ("Buy a quoted phone number with explicit price confirmation") and immediately scopes it to offers produced by ``quote_numbers``. An agent can distinguish it from get_number/release_number/list_numbers without opening any schema.

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?

Makes the prerequisite explicit via ``quote_id`` of one offer from ``quote_numbers`` and sets the retry condition (same quote + idempotency_key = original purchase; new quote after timeout = a second number). It also states exclusions around expired offers (409) and registration selection (422). It does not explicitly contrast with release_number or route_number, so this falls just short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.