Skip to main content
Glama

list_locations

Retrieve all store locations—warehouses, retail stores, or drop-ship partners—with their names, active status, city, country, and GID needed for inventory and fulfillment operations.

Instructions

List the store's locations — physical or virtual places where inventory is stocked or fulfilled from (warehouses, retail stores, drop-ship partners). Returns each location's name, active/inactive flag, city + country, and GID. The location GID is required by set_inventory_quantity and create_fulfillment. Inactive locations still exist but cannot accept new inventory or fulfillments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNoPage size (1-100). Most stores have under a dozen locations.

Implementation Reference

  • GraphQL query that fetches locations (id, name, isActive, address.city, address.countryCode) with pagination via $first
    const LIST_LOCATIONS_QUERY = /* GraphQL */ `
      query ListLocations($first: Int!) {
        locations(first: $first) {
          edges {
            node { id name isActive address { city countryCode } }
          }
        }
      }
    `;
  • Zod schema for list_locations input: optional 'first' number (1-100, default 20) for page size
    const listLocationsSchema = {
      first: z
        .number()
        .int()
        .min(1)
        .max(100)
        .default(20)
        .describe("Page size (1-100). Most stores have under a dozen locations."),
    };
  • The 'list_locations' tool handler: executes GraphQL query, parses locations, returns formatted list with name, active/inactive status, city, country, and GID
    server.tool(
      "list_locations",
      "List the store's locations — physical or virtual places where inventory is stocked or fulfilled from (warehouses, retail stores, drop-ship partners). Returns each location's name, active/inactive flag, city + country, and GID. The location GID is required by set_inventory_quantity and create_fulfillment. Inactive locations still exist but cannot accept new inventory or fulfillments.",
      listLocationsSchema,
      async (args) => {
        const data = await client.graphql<{
          locations: {
            edges: Array<{
              node: {
                id: string;
                name: string;
                isActive: boolean;
                address?: { city?: string | null; countryCode?: string | null };
              };
            }>;
          };
        }>(LIST_LOCATIONS_QUERY, { first: args.first });
        const lines = [
          `Found ${data.locations.edges.length} location(s):`,
          ...data.locations.edges.map(({ node }) => {
            const city = node.address?.city ?? "?";
            const country = node.address?.countryCode ?? "?";
            const active = node.isActive ? "active" : "inactive";
            return `  ${node.name} (${active}) — ${city}, ${country} — ${node.id}`;
          }),
        ];
        return { content: [{ type: "text" as const, text: lines.join("\n") }] };
      },
    );
  • src/server.ts:15-15 (registration)
    Import of registerInventoryTools from inventory module (which registers list_locations)
    import { registerInventoryTools } from "./tools/inventory.js";
  • src/server.ts:59-59 (registration)
    Registration call: registerInventoryTools(s, shopify) invoked when building the MCP server
    registerInventoryTools(s, shopify);
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses return fields, explains inactive location behavior, and implies read-only nature. Lacks mention of authentication, but otherwise transparent for a list tool.

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?

Four sentences pack essential information without redundancy. Front-loaded with purpose, followed by return details, cross-references, and behavior note. Efficient and well-structured.

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

Completeness5/5

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

Given no output schema, description compensates by listing returned fields and explaining GID usage and inactive location constraints. For a simple list tool with one parameter, it is fully complete.

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?

Only one parameter 'first' with schema coverage 100%. The description adds no additional meaning beyond the schema, which already details min/max/default and a note. Baseline 3 is appropriate.

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?

Description clearly states the tool lists store locations (physical or virtual), specifies types (warehouses, retail stores, drop-ship partners), and lists returned fields (name, active/inactive flag, city+country, GID). It is specific and distinguishes within the context of inventory and fulfillment operations.

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

Usage Guidelines4/5

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

Description explains that location GID is required by set_inventory_quantity and create_fulfillment, and that inactive locations cannot accept new inventory or fulfillments. This provides clear when-to-use context, though no explicit alternatives among siblings are mentioned.

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/miller-joe/shopify-mcp'

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