Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

list_ad_accounts

Discover Meta Ad Accounts accessible with your access token. Returns account IDs, names, status, currency, and spend cap. Use to identify which accounts you can manage.

Instructions

List Meta Ad Accounts accessible to the current access token. Returns id (act_XXX), name, account_status, currency, business_name, spend_cap, timezone_name. Use this first to discover what you can work with.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax accounts per page (Meta caps ~500, default 100)
afterNoCursor for next page (from previous response's paging.cursors.after)

Implementation Reference

  • The full ToolDef array entry for 'list_ad_accounts' including the handler function that calls metaGet('/me/adaccounts', {...}) to list Meta Ad Accounts accessible to the current access token.
    export const accountTools: ToolDef[] = [
      {
        name: "list_ad_accounts",
        description:
          "List Meta Ad Accounts accessible to the current access token. Returns id (act_XXX), " +
          "name, account_status, currency, business_name, spend_cap, timezone_name. " +
          "Use this first to discover what you can work with.",
        inputSchema: {
          limit: z
            .number()
            .int()
            .positive()
            .max(500)
            .optional()
            .describe("Max accounts per page (Meta caps ~500, default 100)"),
          after: z
            .string()
            .optional()
            .describe("Cursor for next page (from previous response's paging.cursors.after)"),
        },
        handler: async (args) =>
          metaGet("/me/adaccounts", {
            fields:
              "id,name,account_status,currency,business_name,spend_cap,timezone_name",
            limit: args.limit ?? 100,
            after: args.after,
          }),
      },
  • Input schema for 'list_ad_accounts' defining optional 'limit' (number, max 500) and 'after' (cursor string for pagination) parameters via Zod.
    inputSchema: {
      limit: z
        .number()
        .int()
        .positive()
        .max(500)
        .optional()
        .describe("Max accounts per page (Meta caps ~500, default 100)"),
      after: z
        .string()
        .optional()
        .describe("Cursor for next page (from previous response's paging.cursors.after)"),
  • src/index.ts:47-58 (registration)
    Tools are collected from all modules (including accountTools) into allTools, then registered via server.registerTool() in the loop at lines 65-90.
    const allTools: ToolDef[] = [
      ...accountTools,
      ...campaignTools,
      ...adsetTools,
      ...adTools,
      ...creativeTools,
      ...mediaTools,
      ...insightsTools,
      ...bulkTools,
      ...pageTools,
      ...adsLibraryTools,
    ];
  • The metaGet helper function that builds the URL, appends the access token, executes the GET request to the Meta Graph API, and parses the JSON response.
    export async function metaGet<T = unknown>(
      path: string,
      params: Record<string, unknown> = {},
    ): Promise<T> {
      const qs = buildQuery(params);
      qs.append("access_token", getCurrentToken());
      const url = `${META_API_BASE}${normalizePath(path)}?${qs.toString()}`;
    
      const res = await fetch(url, { method: "GET" });
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(enhanceMetaError(res.status, text));
      }
      const raw = await res.text();
      if (!raw) return {} as T;
      return JSON.parse(raw) as T;
    }
  • The actual handler implementation: calls metaGet('/me/adaccounts') with fields, limit (default 100), and optional after cursor for pagination.
    handler: async (args) =>
      metaGet("/me/adaccounts", {
        fields:
          "id,name,account_status,currency,business_name,spend_cap,timezone_name",
        limit: args.limit ?? 100,
        after: args.after,
      }),
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains pagination via 'limit' and 'after', and lists return fields. It discloses that results are based on the current access token. While it doesn't explicitly state read-only or rate limits, the nature of a list operation is safely implied.

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?

Two sentences front-load the purpose and key information. Every phrase adds value: the action, returned fields, and usage guidance. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description fully compensates by listing returned fields. With only two simple parameters and no nested objects, the description covers purpose, parameters, output, and usage guidance adequately.

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

Parameters4/5

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

Schema coverage is 100% with descriptions for both 'limit' and 'after'. The description adds value beyond the schema by specifying Meta's cap (~500) and default (100) for limit, and the cursor source ('paging.cursors.after') for after, aiding correct parameter usage.

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 'List', the resource 'Meta Ad Accounts', and the scope 'accessible to the current access token'. It enumerates the returned fields and positions itself as the starting point for discovery, distinguishing it from siblings like 'get_ad_account' which fetches a single account.

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

Usage Guidelines4/5

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

Explicitly says 'Use this first to discover what you can work with', guiding the agent to invoke it before other account-specific tools. However, it does not explicitly mention when not to use or directly compare to alternatives like 'get_ad_account'.

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