Skip to main content
Glama
europarcel
by europarcel

Get Carriers

getCarriers

Retrieves all available carriers and their current status to assist in selecting shipping options.

Instructions

Retrieves all available carriers with their status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main tool handler: registerGetCarriersTool function that registers the 'getCarriers' tool on the MCP server. It calls client.getCarriers(), formats the response listing carrier names, IDs, and active status, and handles errors.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { EuroparcelApiClient } from "../../api/client.js";
    import { logger } from "../../utils/logger.js";
    import { apiKeyStorage } from "../../index.js";
    
    export function registerGetCarriersTool(server: McpServer): void {
      // Create API client instance
    
      // Register getCarriers tool
      server.registerTool(
        "getCarriers",
        {
          title: "Get Carriers",
          description: "Retrieves all available carriers with their status",
          inputSchema: {},
        },
        async () => {
          // Get API key from async context
          const apiKey = apiKeyStorage.getStore();
    
          if (!apiKey) {
            return {
              content: [
                {
                  type: "text",
                  text: "Error: X-API-KEY header is required",
                },
              ],
            };
          }
    
          // Create API client with customer's API key
          const client = new EuroparcelApiClient(apiKey);
    
          try {
            logger.info("Fetching carriers");
    
            const carriers = await client.getCarriers();
    
            logger.info(`Retrieved ${carriers.length} carriers`);
    
            let formattedResponse = `Found ${carriers.length} carriers:\n\n`;
    
            carriers.forEach((carrier) => {
              formattedResponse += `${carrier.name} (ID: ${carrier.id})\n`;
              formattedResponse += `  Status: ${carrier.is_active ? "Active" : "Inactive"}\n\n`;
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to fetch carriers", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error fetching carriers: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("getCarriers tool registered successfully");
    }
  • Carrier interface definition: type schema with id (string), is_active (boolean), and name (string) fields.
    export interface Carrier {
      id: string;
      is_active: boolean;
      name: string;
    }
  • Import of registerGetCarriersTool from getCarriers.ts module.
    import { registerGetCarriersTool } from "./getCarriers.js";
  • Registration call: registerGetCarriersTool(server) within registerLocationTools.
    registerGetCarriersTool(server);
  • API client helper method: getCarriers() that calls GET /locations/carriers and returns Carrier[] data.
    async getCarriers(): Promise<Carrier[]> {
      const response = await this.client.get<Carrier[]>("/locations/carriers");
      return response.data;
    }
Behavior3/5

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

The description indicates a read operation ('retrieves'), but lacks details on authentication requirements, error handling, or data freshness. Since no annotations are provided, the description carries the burden and provides minimal behavioral context beyond the basic action.

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?

A single, clear sentence with no unnecessary words. The description is direct and front-loaded with the action and result.

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

Completeness3/5

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

For a simple list tool, the description is minimal but functional. It hints at response fields ('carriers with their status'), but without an output schema, more detail on the response structure would improve completeness.

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?

The input schema has no parameters, so schema description coverage is 100%. The description does not need to add parameter details. It implicitly confirms that no filtering or input is required, which is adequate.

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 clearly states the tool 'retrieves all available carriers with their status', using specific verb and resource. It immediately distinguishes itself from sibling tools like 'getServices' or 'getCountries'.

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?

No guidance on when to use this tool versus alternatives, such as filtering or prerequisites. The description implies simple retrieval but offers no context on appropriate usage.

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/europarcel/mcp-docker'

If you have feedback or need assistance with the MCP directory API, please join our Discord server