Skip to main content
Glama

get_business

Retrieve details of a specific business using its ID. Specify fields to return for targeted data.

Instructions

Get details of a specific business by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
business_idYesBusiness ID
fieldsNoComma-separated fields to return

Implementation Reference

  • The get_business tool handler function registered via server.tool(). It takes a business_id (required) and fields (optional) as input, calls client.get(`/${business_id}`) to fetch business details from the Meta Graph API, and returns the result as JSON text with rate limit info.
    // ─── get_business ─────────────────────────────────────────────
    server.tool(
      "get_business",
      "Get details of a specific business by ID.",
      {
        business_id: z.string().describe("Business ID"),
        fields: z.string().optional().describe("Comma-separated fields to return"),
      },
      async ({ business_id, fields }) => {
        try {
          const params: Record<string, unknown> = {};
          if (fields) params.fields = fields;
          const { data, rateLimit } = await client.get(`/${business_id}`, params);
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Input schema for get_business: business_id (required string) and fields (optional string).
    {
      business_id: z.string().describe("Business ID"),
      fields: z.string().optional().describe("Comma-separated fields to return"),
    },
  • Registration of get_business via server.tool() call inside registerBusinessTools(), which is called from src/index.ts line 90.
    // ─── get_business ─────────────────────────────────────────────
    server.tool(
      "get_business",
      "Get details of a specific business by ID.",
      {
        business_id: z.string().describe("Business ID"),
        fields: z.string().optional().describe("Comma-separated fields to return"),
      },
      async ({ business_id, fields }) => {
        try {
          const params: Record<string, unknown> = {};
          if (fields) params.fields = fields;
          const { data, rateLimit } = await client.get(`/${business_id}`, params);
          return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • The AdsClient.get() method used by the handler to make GET requests to the Meta Graph API.
    async get(
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      return this.request("GET", path, params);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It only says 'Get details' without disclosing return format, pagination, or any side effects. Since this is a read operation, the lack of behavioral context (e.g., what fields are available via the optional 'fields' parameter) leaves the agent guessing.

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 short sentence, front-loaded with verb and target. Every word earns its place.

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

Completeness3/5

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

The tool is simple with only 2 parameters, so a minimal description might be acceptable. However, with no output schema, the description should at least hint at the response shape or how 'details' are scoped. The lack of any guidance on the 'fields' parameter and no linkage to related business tools makes it minimally 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?

The schema descriptions already fully define both parameters: business_id (required) and fields (comma-separated). The description adds no additional semantics beyond what the schema provides. Baseline 3 is appropriate since schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action 'Get details' and the resource 'a specific business by ID'. It distinguishes well from sibling list_businesses by specifying a single entity look-up. However, it doesn't specify the type of details or how this differs from other business-related getters, so not quite a 5.

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 implies when to use (when you have a specific business ID) but provides no explicit context or exclusions. It doesn't contrast with list_businesses or any related tools, leaving the agent to infer the appropriate scenario. This meets the 'implied usage' standard.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools