Skip to main content
Glama

Validate and format a phone number (offline)

parse_phone_number
Read-onlyIdempotent

Validate one phone number offline against libphonenumber metadata and return E.164, international, national and RFC 3966 formats, region, calling code and line type (from the original allocation). Valid means the number fits an allocated range, not that the line is connected or reachable; no carrier/HLR lookup. Read-only. Same engine, keys and limits as POST /v1/parse.

Input Schema

NameRequiredDescriptionDefault
numberYesThe phone number, e.g. "+44 20 7946 0018" or "(213) 373-4253". Max 64 characters.
default_countryNoOptional ISO 3166-1 alpha-2 region used when the number has no +country code, e.g. US, GB.

Output Schema

NameRequiredDescriptionDefault
e164No
inputNo
validYes
reasonNo
countryNo
messageNo
rfc3966No
nationalNo
possibleNo
extensionNo
line_typeNo
calling_codeNo
country_nameNo
internationalNo
non_geographicNo
default_countryNo
national_numberNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/closed-world, so the bar is lower, and the description still adds real value: it defines 'valid' as fitting an allocated range rather than being reachable, rules out carrier/HLR lookups, and notes the engine, keys and limits match the REST endpoint. 'Read-only' restates readOnlyHint=true, which is wasted words but harmless.

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?

Three sentences, front-loaded with the core action and output set, with the definitional caveat and constraints following. Dense but every clause carries information; the redundant 'Read-only' is the only slack.

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?

With an output schema present, the description needn't explain return structure, and it doesn't have to; it still enriches the return by noting line type comes from the original allocation. The only soft spot is the cryptic pointer to POST /v1/parse for 'keys and limits', which an MCP-only agent cannot resolve.

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?

Schema description coverage is 100%, so both parameters (number, default_country) are already fully documented, including examples and the ISO 3166-1 alpha-2 semantics. The description adds no parameter-level detail beyond the output formats, so the baseline 3 applies.

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 first sentence names a precise verb (validate) and resource (one phone number) plus the engine (libphonenumber metadata) and scope (offline), and enumerates the returned formats. It is unmistakably distinct from the sibling get_example_number, which generates numbers rather than parsing a supplied one.

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?

It clearly frames the context of use as an offline validation with no carrier/HLR lookup, and defines what a positive result actually means. What is missing is explicit routing guidance versus the sibling tool (e.g. 'use get_example_number when you need a sample number for a region').

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.

Resources