Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

get_ad

Retrieve a single ad by ID to access full creative details, identify issues, and obtain a preview link for review.

Instructions

Get a single ad by ID. Returns full creative + issues + preview link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYes
fieldsNo

Implementation Reference

  • The handler for the 'get_ad' tool. It calls metaGet with the ad_id as the path and optional fields, defaulting to DEFAULT_AD_FIELDS which includes id, name, adset_id, campaign_id, creative, status, effective_status, created_time, updated_time, issues_info, and preview_shareable_link.
      name: "get_ad",
      description: "Get a single ad by ID. Returns full creative + issues + preview link.",
      inputSchema: {
        ad_id: z.string(),
        fields: z.string().optional(),
      },
      handler: async (args) =>
        metaGet(`/${String(args.ad_id)}`, {
          fields: args.fields ?? DEFAULT_AD_FIELDS,
        }),
    },
  • The input schema for 'get_ad' defines a required 'ad_id' string and optional 'fields' string.
    {
      name: "get_ad",
      description: "Get a single ad by ID. Returns full creative + issues + preview link.",
      inputSchema: {
        ad_id: z.string(),
        fields: z.string().optional(),
      },
      handler: async (args) =>
        metaGet(`/${String(args.ad_id)}`, {
          fields: args.fields ?? DEFAULT_AD_FIELDS,
        }),
    },
  • src/tools/ads.ts:14-93 (registration)
    The 'adTools' array (exported from ads.ts) contains the 'get_ad' tool definition (name, description, inputSchema, handler). This array is imported and registered in both src/index.ts (line 24, 51) and src/http.ts (line 22, 34) via server.registerTool.
    export const adTools: ToolDef[] = [
      {
        name: "list_ads",
        description:
          "List ads. Pass either `ad_account_id` (all ads in account), `adset_id` (ads in one ad set), " +
          "or `campaign_id` (ads in a campaign). Returns id, name, adset_id, creative, status.",
        inputSchema: {
          ad_account_id: z.string().optional(),
          adset_id: z.string().optional(),
          campaign_id: z.string().optional(),
          limit: z.number().int().positive().max(500).optional(),
          after: z.string().optional(),
          effective_status: z.array(z.string()).optional(),
          fields: z.string().optional(),
        },
        handler: async (args) => {
          const parent = args.adset_id
            ? String(args.adset_id)
            : args.campaign_id
            ? String(args.campaign_id)
            : args.ad_account_id
            ? toAdAccountPath(String(args.ad_account_id))
            : null;
          if (!parent) {
            throw new Error(
              "Must provide one of: ad_account_id, adset_id, or campaign_id.",
            );
          }
          return metaGet(`/${parent}/ads`, {
            fields: args.fields ?? DEFAULT_AD_FIELDS,
            limit: args.limit ?? 100,
            after: args.after,
            effective_status: args.effective_status,
          });
        },
      },
    
      {
        name: "get_ad",
        description: "Get a single ad by ID. Returns full creative + issues + preview link.",
        inputSchema: {
          ad_id: z.string(),
          fields: z.string().optional(),
        },
        handler: async (args) =>
          metaGet(`/${String(args.ad_id)}`, {
            fields: args.fields ?? DEFAULT_AD_FIELDS,
          }),
      },
    
      {
        name: "update_ad",
        description:
          "WRITE: Update an ad's name, status, or swap its creative. To replace the creative pass " +
          "`creative: {creative_id: 'XXX'}`.",
        inputSchema: {
          ad_id: z.string(),
          name: z.string().optional(),
          status: STATUS.optional(),
          creative: z
            .record(z.unknown())
            .optional()
            .describe("e.g. {creative_id: '123456'}"),
        },
        handler: async (args) => {
          const { ad_id, ...rest } = args;
          return metaPost(`/${String(ad_id)}`, rest as Record<string, unknown>);
        },
      },
    
      {
        name: "delete_ad",
        description:
          "WRITE: Hard-delete an ad. Prefer update_ad status=ARCHIVED to keep history.",
        inputSchema: {
          ad_id: z.string(),
        },
        handler: async (args) => metaDelete(`/${String(args.ad_id)}`),
      },
    ];
  • The DEFAULT_AD_FIELDS constant defines the default field set returned by get_ad: id, name, adset_id, campaign_id, creative, status, effective_status, created_time, updated_time, issues_info, and preview_shareable_link.
    const DEFAULT_AD_FIELDS =
      "id,name,adset_id,campaign_id,creative,status,effective_status,created_time,updated_time,issues_info,preview_shareable_link";
Behavior3/5

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

With no annotations, description says it returns creative, issues, and preview link, which helps set expectations. However, it omits details like error handling, auth needs, or rate limits.

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?

Single sentence with front-loaded action and key results. 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?

Template-level tool with no output schema; description gives high-level return info but lacks details on parameter format, error cases, and edge behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage; description only explains ad_id implicitly but completely ignores the 'fields' parameter, leaving its purpose and format undocumented.

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?

Clearly states verb 'Get' and resource 'single ad by ID', distinguishing it from list_ads and other get tools. Also specifies return contents: creative, issues, preview link.

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?

Implies usage when an ad ID is known, but provides no explicit guidance on when not to use it or alternatives like list_ads or get_creative.

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/Mike25app/scaleforge-mcp-meta-ads'

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