Skip to main content
Glama
iamfiro

Parcel Tracking MCP Server

by iamfiro

search-carrier

Find parcel carriers by name using fuzzy search to handle typos and spelling variations. This tool helps identify shipping providers for tracking packages across multiple services.

Instructions

Search carriers by name keyword (supports fuzzy typos)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesKeyword to search carrier names, case-insensitive (typos allowed)
limitNoMax number of results to return (default 10)

Implementation Reference

  • Executes the search-carrier tool: performs exact substring search on carrier names (EN/CN/HK), falls back to fuzzy Fuse.js search if no matches, limits results, returns JSON array of {id, name}.
    ({ query, limit = 10 }) => {
      const keyword = query.toLowerCase();
      let exactMatches = carrierRows.filter(
        (row) =>
          row.name_en.toLowerCase().includes(keyword) ||
          row.name_cn.toLowerCase().includes(keyword) ||
          row.name_hk.toLowerCase().includes(keyword)
      );
    
      if (exactMatches.length === 0) {
        exactMatches = fuse.search(keyword).map((m) => m.item as CarrierRow);
      }
    
      const results = exactMatches.slice(0, limit).map((row) => ({ id: Number(row.key), name: row.name_en }));
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(results, null, 2),
          } as const,
        ],
      };
    }
  • Zod input schema defining 'query' (string) and optional 'limit' (number) parameters for the search-carrier tool.
    {
      query: z.string().describe("Keyword to search carrier names, case-insensitive (typos allowed)"),
      limit: z.number().optional().describe("Max number of results to return (default 10)"),
    },
  • src/index.ts:135-166 (registration)
    Registers the 'search-carrier' tool with McpServer using server.tool(name, description, inputSchema, handlerFunction).
    server.tool(
      "search-carrier",
      "Search carriers by name keyword (supports fuzzy typos)",
      {
        query: z.string().describe("Keyword to search carrier names, case-insensitive (typos allowed)"),
        limit: z.number().optional().describe("Max number of results to return (default 10)"),
      },
      ({ query, limit = 10 }) => {
        const keyword = query.toLowerCase();
        let exactMatches = carrierRows.filter(
          (row) =>
            row.name_en.toLowerCase().includes(keyword) ||
            row.name_cn.toLowerCase().includes(keyword) ||
            row.name_hk.toLowerCase().includes(keyword)
        );
    
        if (exactMatches.length === 0) {
          exactMatches = fuse.search(keyword).map((m) => m.item as CarrierRow);
        }
    
        const results = exactMatches.slice(0, limit).map((row) => ({ id: Number(row.key), name: row.name_en }));
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(results, null, 2),
            } as const,
          ],
        };
      }
    );
  • Initializes Fuse.js fuzzy search index on carrierRows, used by search-carrier handler for fallback fuzzy matching.
    const fuse = new Fuse(carrierRows, {
      keys: ["name_en", "name_cn", "name_hk"],
      threshold: 0.4,
      includeScore: true,
    });
  • Parses carriers.csv into carrierRows array, providing the data source for exact and fuzzy searches in search-carrier.
    const carrierRows: CarrierRow[] = parseCsv(fs.readFileSync(carriersCsvPath), {
      bom: true,
      columns: true,
      skip_empty_lines: true,
      trim: true,
      relax_quotes: true,
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it mentions 'supports fuzzy typos', it doesn't describe what 'fuzzy' means operationally, whether there are rate limits, authentication requirements, error conditions, or what the response format looks like. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

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 extremely concise at just one sentence with zero wasted words. It's front-loaded with the core purpose and efficiently adds the key behavioral detail about fuzzy matching in parentheses.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description should do more to compensate. While the purpose is clear, it doesn't describe the return format, error conditions, or operational constraints. For a search tool that presumably returns results, the absence of output information is a significant gap.

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 the schema already fully documents both parameters. The description adds minimal value by mentioning 'keyword' and 'fuzzy typos', but doesn't provide additional syntax, format details, or examples beyond what the schema descriptions already state about case-insensitivity and typos.

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 tool's purpose as 'Search carriers by name keyword' with the specific functionality of 'supports fuzzy typos'. It uses a specific verb ('Search') and resource ('carriers'), but doesn't explicitly differentiate from the sibling tool 'tracking-delivery' which appears to have a different function.

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. It doesn't mention the sibling tool 'tracking-delivery' or any other search methods, nor does it provide context about when this fuzzy search is preferred over exact matching or other filtering approaches.

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/iamfiro/parcel-tracking-mcp'

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