Skip to main content
Glama

get_country_rates

Read-onlyIdempotent

Retrieve calling rate prefixes and prices for a specific country using a two-letter country code to calculate international telephony costs.

Instructions

Get all calling rate prefixes and prices for a specific country.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
country_codeYesTwo-letter country code (e.g. US, GB, DE)

Implementation Reference

  • The handler function that executes get_country_rates logic - makes GET request to /rates/{country_code}
      async (params) => callTool(() => client.get(`/rates/${params.country_code}`))
    );
  • Full registration of the get_country_rates tool including name, description, input schema, annotations, and handler
    server.registerTool(
      "get_country_rates",
      {
        description: "Get all calling rate prefixes and prices for a specific country.",
        inputSchema: {
          country_code: z.string().length(2).describe("Two-letter country code (e.g. US, GB, DE)"),
        },
        annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      },
      async (params) => callTool(() => client.get(`/rates/${params.country_code}`))
    );
  • Input validation schema requiring a 2-letter country code using Zod
    inputSchema: {
      country_code: z.string().length(2).describe("Two-letter country code (e.g. US, GB, DE)"),
    },
  • Helper function that wraps tool execution with error handling - catches ApiError and returns formatted error response
    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}`);
      }
    }
  • BubblyPhoneClient.get() method - makes authenticated HTTP GET request to the API
    async get<T = unknown>(path: string, params?: Record<string, string>): Promise<T> {
      const url = new URL(`${this.baseUrl}${path}`);
      if (params) {
        for (const [key, value] of Object.entries(params)) {
          if (value !== undefined && value !== "") {
            url.searchParams.set(key, value);
          }
        }
      }
      return this.request<T>(url.toString(), { method: "GET" });
    }
Behavior3/5

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

Annotations already declare this as read-only, non-destructive, idempotent, and closed-world. The description adds the modifier 'all' implying comprehensive return of rates, but does not disclose additional behavioral traits like pagination, caching, rate limits, or response format.

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?

The description is a single, efficient 9-word sentence with no filler. It is appropriately front-loaded with the action and resource, delivering maximum information density.

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?

Given this is a simple read-only tool with one parameter and no output schema, the description combined with annotations provides adequate context for invocation. A minor gap exists in not describing the return structure, though no output schema exists to require this.

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?

With 100% schema description coverage ('Two-letter country code'), the schema fully documents the parameter. The description mentions 'specific country' which aligns with the parameter but adds no syntax details, format constraints, or usage examples beyond the schema.

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?

The description clearly states the verb ('Get'), resource ('calling rate prefixes and prices'), and scope ('for a specific country'). However, it does not explicitly differentiate from the sibling tool 'lookup_rate', leaving ambiguity about when to use which rate-related tool.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'lookup_rate', nor does it mention prerequisites or constraints beyond the country_code parameter. It simply states what the tool does, not when to invoke it.

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