Skip to main content
Glama
localseodata

Local SEO Data

Official

local_pack

Read-only

Retrieve businesses from Google's local 3-pack for any keyword and city. Get names, ratings, reviews, phone numbers, websites, hours, and GPS coordinates.

Instructions

Get businesses in Google's local 3-pack for any keyword and city. Returns names, ratings, review counts, phone numbers, websites, hours, and GPS coordinates. Costs 1 credit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesSearch keyword (e.g. "plumber")
locationYesCity and state (e.g. "Orchard Park, NY")
deviceNoDevice type. Default: desktop
depthNoNumber of results. Default: 20, max: 60

Implementation Reference

  • The 'local_pack' tool is registered via server.tool() call inside registerSerpTools(). The registration defines the tool name 'local_pack', its description, input schema (keyword, location, device, depth), and the handler.
    export function registerSerpTools(server: McpServer, getAuth: () => string) {
      server.tool(
        "local_pack",
        "Get businesses in Google's local 3-pack for any keyword and city. Returns names, ratings, review counts, phone numbers, websites, hours, and GPS coordinates. Costs 1 credit.",
        {
          keyword: z.string().describe('Search keyword (e.g. "plumber")'),
          location: z.string().describe('City and state (e.g. "Orchard Park, NY")'),
          device: z.enum(["desktop", "mobile"]).optional().describe("Device type. Default: desktop"),
          depth: z.number().int().min(1).max(60).optional().describe("Number of results. Default: 20, max: 60"),
        },
        READ_ONLY,
        withErrorHandling(async ({ keyword, location, device, depth }) => {
          const result = await callApi(
            "/v1/serp/local-pack",
            { keyword, location, ...(device && { device }), ...(depth && { depth }) },
            getAuth()
          );
          return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
        })
      );
  • The actual tool handler: an async function that calls the API endpoint '/v1/serp/local-pack' with keyword, location, optional device and depth parameters, then formats and returns the result.
    withErrorHandling(async ({ keyword, location, device, depth }) => {
      const result = await callApi(
        "/v1/serp/local-pack",
        { keyword, location, ...(device && { device }), ...(depth && { depth }) },
        getAuth()
      );
      return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
    })
  • The Zod input schema for the local_pack tool: keyword (string), location (string), optional device (enum 'desktop'|'mobile'), optional depth (integer 1-60).
    {
      keyword: z.string().describe('Search keyword (e.g. "plumber")'),
      location: z.string().describe('City and state (e.g. "Orchard Park, NY")'),
      device: z.enum(["desktop", "mobile"]).optional().describe("Device type. Default: desktop"),
      depth: z.number().int().min(1).max(60).optional().describe("Number of results. Default: 20, max: 60"),
  • The READ_ONLY configuration object passed to the tool, setting readOnlyHint=true, destructiveHint=false, openWorldHint=true.
    const READ_ONLY = {
      readOnlyHint: true,
      destructiveHint: false,
      openWorldHint: true,
    } as const;
    
    export function registerSerpTools(server: McpServer, getAuth: () => string) {
      server.tool(
        "local_pack",
        "Get businesses in Google's local 3-pack for any keyword and city. Returns names, ratings, review counts, phone numbers, websites, hours, and GPS coordinates. Costs 1 credit.",
        {
          keyword: z.string().describe('Search keyword (e.g. "plumber")'),
          location: z.string().describe('City and state (e.g. "Orchard Park, NY")'),
          device: z.enum(["desktop", "mobile"]).optional().describe("Device type. Default: desktop"),
          depth: z.number().int().min(1).max(60).optional().describe("Number of results. Default: 20, max: 60"),
        },
        READ_ONLY,
        withErrorHandling(async ({ keyword, location, device, depth }) => {
          const result = await callApi(
            "/v1/serp/local-pack",
            { keyword, location, ...(device && { device }), ...(depth && { depth }) },
            getAuth()
          );
          return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
        })
      );
  • The callApi helper function calls the external LocalSEOData API. For local_pack it hits '/v1/serp/local-pack'. Also exports formatResult and withErrorHandling which format responses and wrap handlers with error handling.
    export async function callApi(
      path: string,
      body: Record<string, unknown>,
      authHeader: string,
      timeoutMs = 60_000
    ): Promise<{ data: unknown; credits_used: number; credits_remaining: number; cached: boolean }> {
Behavior4/5

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

Annotations already mark as readOnly and non-destructive. Description adds value by stating it costs 1 credit and listing the return fields (names, ratings, phone, etc.), which goes beyond the structured annotations.

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?

Two sentences with no wasted words. First sentence defines purpose and scope, second details outputs and cost. Efficient and front-loaded.

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

Completeness4/5

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

No output schema exists, but description enumerates expected return data (names, ratings, etc.) and mentions credit cost. Sufficient for a read-only query tool, though lacks edge case or error handling details.

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?

Input schema coverage is 100% with clear descriptions for all 4 parameters. The description merely restates 'keyword and city' without adding new meaning or usage hints beyond what the schema provides.

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 'Get businesses in Google's local 3-pack for any keyword and city' and lists specific return fields (names, ratings, review counts, etc.), making the tool's purpose very specific and distinguishable from siblings like 'maps' or 'local_finder'.

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?

Implies usage for any keyword and city but does not provide explicit when-to-use or when-not-to-use guidance compared to sibling tools like 'local_finder' or 'organic_serp'. No exclusions or alternative suggestions.

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/localseodata/mcp-server'

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