Skip to main content
Glama
europarcel
by europarcel

Get Fixed Location by ID

getFixedLocationById

Retrieve detailed information about a fixed location using its ID. Access address, contact, and other location details for logistics operations.

Instructions

Retrieves detailed information about a specific fixed location. Requires id parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe fixed location ID (integer, minimum 1)

Implementation Reference

  • The main handler function that registers and implements the 'getFixedLocationById' tool. It validates the API key, calls the API client to fetch a fixed location by ID, and formats the response into a human-readable string.
    export function registerGetFixedLocationByIdTool(server: McpServer): void {
      // Create API client instance
    
      // Register getFixedLocationById tool
      server.registerTool(
        "getFixedLocationById",
        {
          title: "Get Fixed Location by ID",
          description:
            "Retrieves detailed information about a specific fixed location. Requires id parameter.",
          inputSchema: {
            id: z
              .number()
              .int()
              .min(1)
              .describe("The fixed location ID (integer, minimum 1)"),
          },
        },
        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 {
            if (!args.id) {
              return {
                content: [
                  {
                    type: "text",
                    text: "Error: id parameter is required",
                  },
                ],
              };
            }
    
            logger.info("Fetching fixed location by ID", { id: args.id });
    
            const location = await client.getFixedLocationById(args.id);
    
            logger.info(`Retrieved fixed location ${location.id}`);
    
            let formattedResponse = `Fixed Location Details:\n\n`;
            formattedResponse += `Name: ${location.name}\n`;
            formattedResponse += `ID: ${location.id}\n`;
            formattedResponse += `Type: ${location.fixed_location_type}\n`;
            formattedResponse += `Status: ${location.is_active ? "Active" : "Inactive"}\n\n`;
    
            formattedResponse += `Carrier: ${location.carrier_name} (ID: ${location.carrier_id})\n`;
            formattedResponse += `Address: ${location.address}\n`;
            formattedResponse += `Location: ${location.locality_name}, ${location.county_name}, ${location.country_code}\n`;
            formattedResponse += `Drop-off allowed: ${location.allows_drop_off ? "Yes" : "No"}\n`;
            formattedResponse += `Payment type: ${location.payment_type}\n\n`;
    
            formattedResponse += `Coordinates:\n`;
            formattedResponse += `  Latitude: ${location.coordinates.lat}\n`;
            formattedResponse += `  Longitude: ${location.coordinates.long}\n\n`;
    
            if (location.schedule) {
              formattedResponse += `Schedule: ${JSON.stringify(location.schedule, null, 2)}\n`;
            }
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to fetch fixed location by ID", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error fetching fixed location: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("getFixedLocationById tool registered successfully");
    }
  • Input schema for the tool: requires 'id' (number, int, min 1) as the fixed location ID parameter.
    {
      title: "Get Fixed Location by ID",
      description:
        "Retrieves detailed information about a specific fixed location. Requires id parameter.",
      inputSchema: {
        id: z
          .number()
          .int()
          .min(1)
          .describe("The fixed location ID (integer, minimum 1)"),
      },
    },
  • The FixedLocation interface defining all fields returned by the API, including id, name, address, coordinates, schedule, and more.
    export interface FixedLocation {
      id: number;
      fixed_location_type: string;
      carrier_id: number;
      carrier_name: string;
      locality_id: number;
      locality_name: string;
      county_id: number;
      county_name: string;
      country_code: string;
      name: string;
      address: string;
      allows_drop_off: boolean;
      is_active: boolean;
      coordinates: {
        lat: number;
        long: number;
      };
      schedule: any;
      payment_type: string;
    }
  • Registration of getFixedLocationByIdTool in the locations module index. Imports and calls registerGetFixedLocationByIdTool as part of the location tools setup.
    import { registerGetFixedLocationByIdTool } from "./getFixedLocationById.js";
    import { logger } from "../../utils/logger.js";
    
    export function registerLocationTools(server: McpServer): void {
      logger.info("Registering location tools...");
    
      // Register all location-related tools
      registerGetCountriesTool(server);
      registerGetCountiesTool(server);
      registerGetLocalitiesTool(server);
      registerGetCarriersTool(server);
      registerGetServicesTool(server);
      registerGetFixedLocationsTool(server);
      registerGetFixedLocationByIdTool(server);
    
      logger.info("All location tools registered successfully");
    }
    
    // Export individual registration functions if needed
    export { registerGetCountriesTool } from "./getCountries.js";
    export { registerGetCountiesTool } from "./getCounties.js";
    export { registerGetLocalitiesTool } from "./getLocalities.js";
    export { registerGetCarriersTool } from "./getCarriers.js";
    export { registerGetServicesTool } from "./getServices.js";
    export { registerGetFixedLocationsTool } from "./getFixedLocations.js";
    export { registerGetFixedLocationByIdTool } from "./getFixedLocationById.js";
  • API client method that makes the HTTP GET request to /locations/fixedlocations/{id} to fetch a fixed location by ID.
    /**
     * Get fixed location by ID
     */
    async getFixedLocationById(id: number): Promise<FixedLocation> {
      const response = await this.client.get<FixedLocation>(
        `/locations/fixedlocations/${id}`,
      );
      return response.data;
    }
Behavior1/5

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

No annotations are provided, so the description should fully disclose behavioral traits. It only repeats the schema's 'requires id' without mentioning read-only nature, rate limits, or response behavior. This provides zero additional behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences with no fluff, but the content is minimal. It is not overly verbose, but it lacks depth. Appropriately sized for the information provided.

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 and no annotations, the description is too sparse. It does not mention what 'detailed information' includes, error cases, or any additional context needed to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. However, the description adds no meaning beyond the schema; it merely restates 'requires id parameter'. No extra context on parameter purpose or format is given.

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 verb 'Retrieves' and the resource 'detailed information about a specific fixed location', distinguishing it from the sibling list tool 'getFixedLocations'. It also explicitly mentions the required 'id' parameter.

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 (e.g., when needing a single location vs. listing all). The description only states the parameter requirement, not the context of use.

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