Skip to main content
Glama
europarcel
by europarcel

Search Streets

searchStreets

Search for streets in a Romanian locality by providing the locality ID and a partial street name. Returns matching street names.

Instructions

Search for streets in a specific locality. Parameters: country_code (required), locality_id (required), search (required)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
country_codeYesThe country code - must be 'RO' (Romania)
locality_idYesThe locality ID to search within
searchYesThe search term for street names (minimum 2 characters)

Implementation Reference

  • Main handler that registers the 'searchStreets' tool on the MCP server. Defines input schema (country_code, locality_id, search), validates params, calls the API client, and formats the response.
    export function registerSearchStreetsTool(server: McpServer): void {
      // Create API client instance
    
      // Register searchStreets tool
      server.registerTool(
        "searchStreets",
        {
          title: "Search Streets",
          description:
            "Search for streets in a specific locality. Parameters: country_code (required), locality_id (required), search (required)",
          inputSchema: {
            country_code: z
              .enum(["RO"])
              .describe("The country code - must be 'RO' (Romania)"),
            locality_id: z
              .number()
              .min(1)
              .describe("The locality ID to search within"),
            search: z
              .string()
              .min(2)
              .describe("The search term for street names (minimum 2 characters)"),
          },
        },
        async (args: any) => {
          // 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 {
            // Validate required parameters
            if (!args.country_code) {
              return {
                content: [
                  {
                    type: "text",
                    text: "Error: country_code parameter is required",
                  },
                ],
              };
            }
    
            if (!args.locality_id || !Number.isInteger(Number(args.locality_id))) {
              return {
                content: [
                  {
                    type: "text",
                    text: "Error: locality_id parameter is required and must be a number",
                  },
                ],
              };
            }
    
            if (
              !args.search ||
              typeof args.search !== "string" ||
              args.search.length < 1
            ) {
              return {
                content: [
                  {
                    type: "text",
                    text: "Error: search parameter is required",
                  },
                ],
              };
            }
    
            logger.info("Searching streets", {
              country_code: args.country_code,
              locality_id: args.locality_id,
              search: args.search,
            });
    
            const streets = await client.searchStreets(
              args.country_code.toUpperCase(),
              Number(args.locality_id),
              args.search,
            );
    
            logger.info(`Found ${streets.length} streets`);
    
            let formattedResponse = `Found ${streets.length} streets matching "${args.search}" in locality #${args.locality_id}:\n\n`;
    
            if (streets.length === 0) {
              formattedResponse += "No streets found.";
            } else {
              streets.forEach((street) => {
                formattedResponse += `🛣️  ${street.street_name}\n`;
                formattedResponse += `   ID: ${street.id}\n`;
                formattedResponse += `   Postal Code: ${street.postal_code}\n\n`;
              });
            }
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to search streets", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error searching streets: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("searchStreets tool registered successfully");
    }
  • Input schema for searchStreets using Zod: country_code (enum RO), locality_id (number min 1), search (string min 2 chars).
    inputSchema: {
      country_code: z
        .enum(["RO"])
        .describe("The country code - must be 'RO' (Romania)"),
      locality_id: z
        .number()
        .min(1)
        .describe("The locality ID to search within"),
      search: z
        .string()
        .min(2)
        .describe("The search term for street names (minimum 2 characters)"),
    },
  • Registration of searchStreets tool via registerSearchStreetsTool(server) in the search tools index.
    // Register all search-related tools
    registerSearchLocalitiesTool(server);
    registerSearchStreetsTool(server);
  • API client method searchStreets that makes a GET request to /search/streets/{countryCode}/{localityId}/{search} and returns StreetSearchResult[].
    /**
     * Search streets by country, locality and name
     */
    async searchStreets(
      countryCode: string,
      localityId: number,
      search: string,
    ): Promise<StreetSearchResult[]> {
      const response = await this.client.get<StreetSearchResult[]>(
        `/search/streets/${countryCode}/${localityId}/${search}`,
      );
      return response.data;
    }
  • Type definition StreetSearchResult with id, street_name, and postal_code fields.
    export interface StreetSearchResult {
      id: number;
      street_name: string;
      postal_code: string;
    }
Behavior2/5

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

No annotations are provided, and the description fails to disclose behavioral traits such as idempotency, authorization needs, rate limits, or side effects. For a search tool, this is a significant gap.

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?

The description is short and to the point, containing only two sentences. However, the parameter enumeration is redundant with the schema, slightly reducing efficiency.

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 no output schema, the description should explain the return format or behavior, but it does not. The tool's completeness is lacking for a search operation.

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 coverage is 100%, so baseline is 3. The description merely repeats parameter names and requirements already in the schema, adding no additional meaning beyond listing them.

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's purpose: 'Search for streets in a specific locality.' The verb 'search' and resource 'streets' are specific, and it distinguishes from sibling tools like 'searchLocalities' and 'trackOrdersByIds'.

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

Usage Guidelines3/5

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

No explicit guidance on when to use vs. alternatives is provided. The description lists required parameters but does not mention when not to use or suggest other tools, though the sibling list implies differentiation.

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