Skip to main content
Glama
localseodata

Local SEO Data

Official

business_profile

Read-only

Retrieve a complete Google Business Profile including name, rating, reviews, address, phone, website, hours, categories, attributes, photos, description, and verification status.

Instructions

Get a complete Google Business Profile including name, rating, reviews, address, phone, website, hours, categories, attributes, photos count, description, and verification status. Costs 2 credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
business_nameYesBusiness name
locationYesCity and state
place_idNoGoogle Place ID for exact match

Implementation Reference

  • src/server.ts:34-36 (registration)
    Registers business_profile tool via registerBusinessTools call in the MCP server initialization.
    registerAccountTools(server, getAuth);
    registerSerpTools(server, getAuth);
    registerBusinessTools(server, getAuth);
  • The registerBusinessTools function registers the 'business_profile' tool with its handler, which calls the API endpoint /v1/business/profile with business_name, location, and optional place_id parameters.
    export function registerBusinessTools(server: McpServer, getAuth: () => string) {
      server.tool(
        "business_profile",
        "Get a complete Google Business Profile including name, rating, reviews, address, phone, website, hours, categories, attributes, photos count, description, and verification status. Costs 2 credits.",
        {
          business_name: z.string().describe("Business name"),
          location: z.string().describe("City and state"),
          place_id: z.string().optional().describe("Google Place ID for exact match"),
        },
        READ_ONLY,
        withErrorHandling(async ({ business_name, location, place_id }) => {
          const result = await callApi(
            "/v1/business/profile",
            { business_name, location, ...(place_id && { place_id }) },
            getAuth()
          );
          return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
        })
      );
  • Zod schema defining input parameters: business_name (string, required), location (string, required), place_id (string, optional).
    {
      business_name: z.string().describe("Business name"),
      location: z.string().describe("City and state"),
      place_id: z.string().optional().describe("Google Place ID for exact match"),
    },
  • The callApi helper function that makes authenticated POST requests to the API. Used by the business_profile handler.
    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 }> {
      const url = `${env.API_BASE_URL}${path}`;
    
      console.log(`[api] POST ${url} (timeout: ${timeoutMs / 1000}s, auth: ${authHeader ? `${authHeader.slice(0, 15)}...` : "MISSING"})`);
    
      const response = await fetch(url, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: authHeader,
        },
        body: JSON.stringify(body),
        signal: AbortSignal.timeout(timeoutMs),
      });
    
      if (!response.ok) {
        const text = await response.text();
        console.error(`[api] ${response.status} ${response.statusText} from ${path}: ${text.slice(0, 200)}`);
        // Try to parse as structured error
        try {
          const result = JSON.parse(text) as ApiErrorResponse;
          if (result.status === "error") {
            const err = result.error;
            const reqId = result.request_id ? ` [request_id: ${result.request_id}]` : "";
            throw new Error(
              err.required_credits
                ? `${err.message} (requires ${err.required_credits} credits, balance: ${err.current_balance})${reqId}`
                : `${err.message}${reqId}`
            );
          }
        } catch (parseErr) {
          if (parseErr instanceof Error && parseErr.message !== "error") {
            // Re-throw if it's our structured error from above
            if (!text.includes('"status":"error"')) {
              throw new Error(`API returned ${response.status}: ${text.slice(0, 200)}`);
            }
            throw parseErr;
          }
        }
        throw new Error(`API returned ${response.status}: ${text.slice(0, 200)}`);
      }
    
      const result = (await response.json()) as ApiResponse;
    
      if (result.status === "error") {
        const err = (result as ApiErrorResponse).error;
        const reqId = (result as ApiErrorResponse).request_id ? ` [request_id: ${(result as ApiErrorResponse).request_id}]` : "";
        throw new Error(
          err.required_credits
            ? `${err.message} (requires ${err.required_credits} credits, balance: ${err.current_balance})${reqId}`
            : `${err.message}${reqId}`
        );
      }
    
      console.log(`[api] ${path} OK (${result.credits_used} credits used, ${result.credits_remaining} remaining)`);
    
      return {
        data: result.data,
        credits_used: result.credits_used,
        credits_remaining: result.credits_remaining,
        cached: result.cached,
      };
    }
  • The withErrorHandling wrapper that catches errors from the tool handler and returns them as MCP error content.
    export function withErrorHandling<T>(
      fn: (args: T) => Promise<ToolResult>
    ): (args: T) => Promise<ToolResult> {
      return async (args) => {
        try {
          return await fn(args);
        } catch (err) {
          const message = err instanceof Error ? err.message : String(err);
          console.error(`[mcp] Tool error: ${message}`);
          return {
            content: [{ type: "text" as const, text: `Error: ${message}` }],
            isError: true,
          };
        }
      };
    }
Behavior4/5

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

Annotations already indicate read-only and non-destructive. The description adds that it costs 2 credits, a valuable behavioral detail. It also lists included fields, providing context beyond 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?

One dense sentence front-loads the purpose, lists key fields, and ends with credit cost. Every word contributes; no fluff.

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?

Despite no output schema, the description enumerates all major returned fields (name, rating, reviews, etc.) and notes credit cost. No gaps remain for this retrieval tool.

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% with three parameters (business_name, location, place_id) clearly described. The description does not add additional parameter info, so baseline of 3 applies.

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 begins with 'Get a complete Google Business Profile' which clearly states the action and resource. It lists many specific data fields (name, rating, reviews, etc.), distinguishing it from sibling tools like 'google_reviews' which only fetch reviews.

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?

The purpose is clear: retrieve a full profile. It implies use when needing comprehensive data. However, it lacks explicit guidance on when not to use or how it compares to siblings. The credit cost is 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/localseodata/mcp-server'

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