Skip to main content
Glama

Route a number to an agent

route_number
DestructiveIdempotent

Set the saved agents that answer a number's calls and texts.

    Replaces the selected routing settings. Registering or unregistering inbound
    voice can change carrier and LiveKit routing; text-only changes leave it unchanged.
    Clearing the voice route stops AI call answers; clearing the text route stops
    agent replies to texts. Restoring a route does not recover missed interactions.
    Omitted settings retain their current values. A connected number
    (``source`` ``connected``) in state ``unverified`` returns an error
    until its ownership check succeeds in the console or the API.
    Returns the updated number record or an error.

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": {
      "number_id": "<number_id>"
    },
    "name": "route_number"
  }
}

Input Schema

NameRequiredDescriptionDefault
clear_smsNo``true`` removes the agent that answers texts.
llm_modelNoThe calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics.
number_idYesWorkspace phone number ID, from ``list_numbers`` or ``acquire_number``.
clear_voiceNo``true`` removes the agent that answers calls.
sms_agent_idNoAgent that answers incoming texts, from ``list_agents`` or ``create_agent``.
voice_agent_idNoAgent that answers incoming calls, from ``list_agents`` or ``create_agent``.

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"
      -      },
      -      "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"
      -    ],
      -    "title": "PhoneNumberResponse",
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "error": {
      -        "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"
      +      },
      +      "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"
      +    ],
      +    "title": "PhoneNumberResponse",
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "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"
      +      },
      +      "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"
      +    ],
      +    "title": "PhoneNumberResponse",
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / title
      Removed value: -"route_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. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructive, idempotent, non-read-only, open-world, so the safety profile is partly pre-supplied. The description nonetheless adds real substance beyond them: replace-not-merge semantics ('Omitted settings retain their current values'), carrier/LiveKit side effects of voice changes, the fact that cleared routes stop answering, irrecoverability of missed interactions, and the unverified-number error. It is inconsistent that this counts only 3 — it should be 5.

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?

The mutation scope is front-loaded in the first sentence and the remaining lines are dense operational facts rather than filler. Minor waste from docstring artifacts (double backticks) and some repetition of clearing semantics, but nothing that obscures the call.

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 routing mutation with six parameters, it covers side effects, idempotency-by-replacement, error conditions, and irreversibility. With an output schema present it does not need to detail the return payload, and its single line about returning the updated number record suffices.

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 the baseline is 3, but the description earns more by explaining the replace-vs-retain contract that governs how omitted parameters behave, which is not spelled out in the schema. It also ties clear_voice/clear_sms to concrete outcomes (AI call answers stop, agent text replies stop).

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?

Opens with a specific verb and resource: 'Set the saved agents that answer a number's calls and texts,' which tells an agent this mutates routing on a specific number rather than agent or number records. It does not name a sibling disambiguation (e.g. route_email_domain), but the scope is unambiguous on its own.

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?

Usage is implied rather than stated: the description makes clear this is the tool for changing which agents answer calls/texts, and it gives a key precondition (unverified connected numbers return an error until ownership check succeeds). It never says when not to use it or which sibling handles adjacent cases such as email-domain routing.

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.