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);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only says 'Get details' without disclosing potential errors, permissions, or side effects. The minimal description leaves behavior ambiguous.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no unnecessary words, efficiently conveying the core action. It is front-loaded but could arguably include a bit more context without losing conciseness.

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?

Given the simple tool (2 parameters, no output schema), the description is barely adequate. It lacks information on return format or behavior for missing IDs, which would be useful for an agent.

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%, so the schema already documents both parameters. The description adds no additional meaning beyond what is in the schema.

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 the verb 'Get details' and the resource 'business by ID', distinguishing it from sibling tools like list_businesses and other get_ tools.

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?

No explicit guidance on when to use this tool versus alternatives (e.g., list_businesses for multiple). The context implies single-business retrieval, but no when-not or alternatives 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/mikusnuz/meta-ads-mcp'

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