Skip to main content
Glama

Validate and format a phone number

validate_phone
Read-onlyIdempotent

Validates a phone number using Google's libphonenumber rules and returns it in E.164 (+14155552671), international and national formats, plus the country and line type (mobile, fixed line, toll free...). For numbers without a +country code, pass default_country.

Input Schema

NameRequiredDescriptionDefault
phoneYes
default_countryNoTwo-letter country code used when the number has no "+" prefix, e.g. "US", "GB", "DE"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and non-destructive, so safety is covered. The description adds real behavioral context the annotations don't: the validation ruleset used and the full set of derived values returned. It stops short of describing failure/error behavior for invalid numbers, which matters for a validator.

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?

Two sentences, no filler, with the core purpose and return values front-loaded and the conditional parameter guidance placed last where it belongs.

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 no output schema, the description carries the return-value burden and does so thoroughly (three formats plus country and line type). The only missing piece is what an invalid number yields (error vs. a valid:false result), which an agent calling a validator would want to know.

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 only 50% (the phone parameter itself has no description), so the prose must compensate. It does: it explains when default_country is needed and implies the phone input may or may not carry a + prefix, resolving the ambiguity the schema leaves.

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 description states a specific verb (validates) and resource (phone number), names the underlying rule set (Google's libphonenumber), and enumerates exactly what the tool produces (E.164, international, national, country, line type). This clearly separates it from sibling validators like validate_email or validate_iban.

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 gives an explicit conditional instruction: for numbers without a +country code, pass default_country. That is useful routing guidance for the main ambiguity in this tool. It doesn't say what happens on failure or when to prefer another tool, but no sibling realistically overlaps with phone validation.

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