Skip to main content
Glama

get_ad

Retrieve details of a specific ad by providing its ID and optional fields.

Instructions

Get details of a specific ad by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYesAd ID
fieldsNoComma-separated fields to return

Implementation Reference

  • The get_ad tool handler: calls the Facebook Ads API via client.get with the ad ID and optional fields, returns ad details as JSON.
    // ─── get_ad ────────────────────────────────────────────────
    server.tool(
      "get_ad",
      "Get details of a specific ad by ID.",
      {
        ad_id: z.string().describe("Ad ID"),
        fields: z.string().optional().describe("Comma-separated fields to return"),
      },
      async ({ ad_id, fields }) => {
        try {
          const params: Record<string, unknown> = {};
          if (fields) params.fields = fields;
          const { data, rateLimit } = await client.get(`/${ad_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_ad: requires ad_id (string) and optional fields (string).
    {
      ad_id: z.string().describe("Ad ID"),
      fields: z.string().optional().describe("Comma-separated fields to return"),
    },
  • src/index.ts:52-52 (registration)
    Registration of registerAdTools which includes the get_ad tool.
    registerAdTools(server, client);
  • src/tools/ads.ts:36-37 (registration)
    Tool registration via server.tool('get_ad', ...) in the registerAdTools function.
    server.tool(
      "get_ad",
Behavior2/5

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

No annotations exist, and the description does not disclose any behavioral traits (e.g., permissions, rate limits, handling of deleted ads). It only says 'get details' without specifying any safety or side-effect information.

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?

Extremely concise: one sentence front-loading the purpose. No wasted words.

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 (2 params, no output schema), but the description is minimal. It doesn't explain return structure or any limitations. Adequate for a simple read tool but could be more informative.

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 both ad_id and fields described concisely. The description adds no extra meaning beyond the schema, so baseline 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 clearly states 'Get details of a specific ad by ID' – specific verb+resource, and distinguishes from siblings like list_ads, create_ad, etc.

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 when-to-use or alternatives provided. It's implied that this is for fetching a single ad given an ID, but lacks guidance on when to use instead of list_ads or get_ad_insights.

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