Skip to main content
Glama
localseodata

Local SEO Data

Official

profile_health

Read-only

Audit a Google Business Profile to check completeness, identify missing or incomplete fields, and receive actionable recommendations for improvement.

Instructions

Audit a Google Business Profile's completeness. Returns a completeness score, missing/incomplete fields, and actionable recommendations. Costs 2 credits.

Input Schema

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

Implementation Reference

  • The handler function for the 'profile_health' tool. It calls the '/v1/profile/health' API endpoint with business_name, location, and optional place_id, then formats and returns the result. The tool audits a Google Business Profile's completeness, returning a completeness score, missing/incomplete fields, and actionable recommendations.
    server.tool(
      "profile_health",
      "Audit a Google Business Profile's completeness. Returns a completeness score, missing/incomplete fields, and actionable recommendations. 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/profile/health",
          { business_name, location, ...(place_id && { place_id }) },
          getAuth()
        );
        return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
      })
    );
  • Input schema for 'profile_health' tool using Zod: business_name (string), location (string), and optional place_id (string). These define what the user must provide to run the tool.
    {
      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 registerBusinessTools function registers the 'profile_health' tool (along with business_profile, qa, and business_listings) on the MCP server via server.tool(). This is called from src/server.ts line 36.
    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) }] };
        })
      );
    
      server.tool(
        "profile_health",
        "Audit a Google Business Profile's completeness. Returns a completeness score, missing/incomplete fields, and actionable recommendations. 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/profile/health",
            { business_name, location, ...(place_id && { place_id }) },
            getAuth()
          );
          return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
        })
      );
    
      server.tool(
        "qa",
        "Get Questions & Answers from a Google Business Profile. Returns questions with their answers, authors, dates, and upvotes. Costs 1 credit.",
        {
          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/qa",
            { business_name, location, ...(place_id && { place_id }) },
            getAuth()
          );
          return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
        })
      );
    
      server.tool(
        "business_listings",
        "Search for businesses by category and location. Returns a list of businesses with name, rating, reviews, address, phone, place_id, and categories. Costs 10 credits per 50 results.",
        {
          category: z.string().describe('Business category (e.g. "plumber", "dentist")'),
          location: z.string().describe("City and state"),
          limit: z.number().int().min(1).max(200).optional().describe("Number of results (1-200). Default: 50"),
        },
        READ_ONLY,
        withErrorHandling(async ({ category, location, limit }) => {
          const result = await callApi(
            "/v1/business/listings",
            { category, location, ...(limit && { limit }) },
            getAuth()
          );
          return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] };
        })
      );
    }
  • src/server.ts:36-36 (registration)
    Where registerBusinessTools is called to register all business tools including 'profile_health' on the MCP server.
    registerBusinessTools(server, getAuth);
  • The callApi function used by the handler to make POST requests to the API, along with withErrorHandling (lines 143-158) which wraps handlers to catch errors and return them as MCP error content.
    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,
      };
    }
Behavior4/5

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

Annotations provide readOnlyHint true and destructiveHint false, indicating a safe read operation. The description adds the cost of 2 credits, which is beyond annotations. No contradictions.

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?

The description is two sentences and 16 words, front-loaded with the purpose. Every word adds value, with no unnecessary information.

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, the description adequately covers return values (completeness score, missing fields, recommendations) and mentions cost. As a read-only tool with clear annotations, it is fully sufficient for an agent to use correctly.

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 description coverage is 100% with each parameter having a basic description. The tool's description does not add additional semantics beyond what is in the schema, so baseline score of 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?

The description clearly states it audits a Google Business Profile's completeness, using specific verb 'Audit' and resource 'Google Business Profile's completeness'. It distinguishes from sibling tools like citation_audit or local_audit by focusing on completeness scoring and recommendations.

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 description explains the tool returns a completeness score, missing fields, and recommendations, but it does not explicitly state when to use this tool over alternatives or provide usage exclusions. Context is implied but not explicit.

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