Skip to main content
Glama

list_videos

Retrieve a list of ad videos from your ad account. Filter by fields, limit results, and paginate through videos.

Instructions

List ad videos uploaded to 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 handler for the list_videos MCP tool. It calls the Meta Ads API GET /act_{accountId}/advideos with optional fields, limit, and after (pagination) parameters, then returns the result as JSON with rate limit info.
    server.tool(
      "list_videos",
      "List ad videos uploaded to 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}/advideos`, 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 schema for list_videos input: optional fields, limit (default 25), and after (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"),
    },
  • The registerVideoTools function is where list_videos is registered via server.tool().
    export function registerVideoTools(server: McpServer, client: AdsClient): void {
  • src/index.ts:57-58 (registration)
    Registration call site in the main server initialization (line 57 is registerVideoTools).
    registerVideoTools(server, client);
    registerCanvasTools(server, client);
  • The AdsClient.accountPath getter used by the handler to construct the API URL (/act_{accountId}/advideos).
    get accountPath(): string {
      return `/act_${this.accountId}`;
    }
    
    get accountId(): string {
      if (!this.config.adAccountId) {
        throw new Error(
          "META_AD_ACCOUNT_ID is not configured. Set it as an environment variable."
        );
      }
      return this.config.adAccountId;
    }
Behavior2/5

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

With no annotations, the description fails to disclose behavioral traits such as pagination behavior (beyond 'after' parameter), rate limits, or required permissions. It only states the basic action.

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?

A single sentence with no wasted words. The description is front-loaded and efficient for the tool's simplicity.

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 tool's low complexity (3 optional params, no output schema), the description covers the primary purpose. However, it lacks behavioral context that could help an agent, such as default ordering or result structure.

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% and each parameter has a description in the schema. The description does not add additional context beyond what the schema provides, so baseline score of 3 is appropriate.

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 tool lists ad videos uploaded to the ad account, specifying the verb (list), resource (ad videos), and scope. It distinguishes from sibling tools like list_images and list_creatives.

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?

No guidance is provided on when to use this tool versus other list tools. No mention of filtering, ordering, or alternatives.

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