Skip to main content
Glama

list_creatives

Retrieve ad creatives from your Meta Ads account with optional field selection, result limit, and pagination cursor.

Instructions

List ad creatives in the ad account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNoComma-separated fields to return
limitNoNumber of results (default 25)
afterNoPagination cursor for next page

Implementation Reference

  • The async handler function that executes the 'list_creatives' tool logic. It accepts optional 'fields', 'limit', and 'after' parameters, then calls client.get with the account path and '/adcreatives' endpoint, returning the JSON data with rate limit info.
      async ({ fields, limit, after }) => {
        try {
          const params: Record<string, unknown> = {};
          if (fields) params.fields = fields;
          if (limit) params.limit = limit;
          if (after) params.after = after;
          const { data, rateLimit } = await client.get(`${client.accountPath}/adcreatives`, 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 };
        }
      }
    );
  • Zod input schema for 'list_creatives'. Defines three optional parameters: 'fields' (string), 'limit' (number, default 25), and 'after' (string, pagination cursor).
    {
      fields: z.string().optional().describe("Comma-separated fields to return"),
      limit: z.number().optional().default(25).describe("Number of results (default 25)"),
      after: z.string().optional().describe("Pagination cursor for next page"),
    },
  • Registration of 'list_creatives' as an MCP tool via server.tool(). The tool is named 'list_creatives' with description 'List ad creatives in the ad account.'
    server.tool(
      "list_creatives",
      "List ad creatives in the ad account.",
      {
        fields: z.string().optional().describe("Comma-separated fields to return"),
        limit: z.number().optional().default(25).describe("Number of results (default 25)"),
        after: z.string().optional().describe("Pagination cursor for next page"),
      },
      async ({ fields, limit, after }) => {
        try {
          const params: Record<string, unknown> = {};
          if (fields) params.fields = fields;
          if (limit) params.limit = limit;
          if (after) params.after = after;
          const { data, rateLimit } = await client.get(`${client.accountPath}/adcreatives`, 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 };
        }
      }
    );
  • src/index.ts:53-53 (registration)
    Top-level call to registerCreativeTools(server, client) which registers the 'list_creatives' tool along with other creative tools.
    registerCreativeTools(server, client);
  • The accountPath getter on AdsClient used in the handler to construct the API endpoint URL: /act_{accountId}/adcreatives.
    get accountPath(): string {
      return `/act_${this.accountId}`;
    }

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?

With no annotations, the description carries the full burden of behavioral disclosure. It does not mention pagination via 'after', the default 'limit' of 25, the effect of 'fields', or the return structure. The description adds little beyond restating the tool's name.

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 a single concise sentence with no unnecessary words. It is front-loaded with the action and resource, making it efficient and scannable.

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 description identifies the resource and scope, but it omits details such as how the ad account is determined (no account ID parameter) and what the response contains. Given the simple list operation and parameter coverage, it is minimally adequate but could benefit from a note on pagination or default behavior.

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?

All three parameters (after, limit, fields) have descriptive entries in the schema, so the schema coverage is complete. The tool description adds no extra meaning about these parameters, warranting the baseline score of 3.

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 uses a specific verb 'list' and names the resource 'ad creatives' with a scope 'ad account', clearly distinguishing it from tools like get_creative (single creative) and create_creative. The function is immediately obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives such as get_creative for a single creative or create_creative for creating. It does not mention prerequisites, pagination usage, or any exclusions.

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