Skip to main content
Glama
ZLeventer

linkedin-campaign-manager-mcp

li_list_ad_accounts

List your accessible LinkedIn ad accounts with IDs, names, statuses, currency, and type. Start here to obtain the ad_account_id needed by other tools. Optionally filter by status.

Instructions

List all LinkedIn ad accounts the authenticated user has access to. Returns account ID, name, status, currency, type (BUSINESS/ENTERPRISE), and reference organization URN. Use this first to discover the ad_account_id needed by other tools. Filter by status (ACTIVE/CANCELED/DRAFT/PENDING_DELETION/REMOVED) or omit to see all accounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by ad account status. Omit to return accounts in all statuses.
page_sizeNoNumber of results per page (max 100).

Implementation Reference

  • src/index.ts:58-63 (registration)
    Registration of the 'li_list_ad_accounts' tool with the MCP server, binding the schema and handler.
    server.tool(
      "li_list_ad_accounts",
      "List all LinkedIn ad accounts the authenticated user has access to. Returns account ID, name, status, currency, type (BUSINESS/ENTERPRISE), and reference organization URN. Use this first to discover the ad_account_id needed by other tools. Filter by status (ACTIVE/CANCELED/DRAFT/PENDING_DELETION/REMOVED) or omit to see all accounts.",
      listAdAccountsSchema,
      async (args) => { try { return ok(await listAdAccounts(args)); } catch (e) { return err(e); } }
    );
  • Zod schema defining input parameters for li_list_ad_accounts: optional status enum filter and page_size (default 50, max 100).
    export const listAdAccountsSchema = {
      status: z
        .enum(["ACTIVE", "CANCELED", "DRAFT", "PENDING_DELETION", "REMOVED"])
        .optional()
        .describe("Filter by ad account status. Omit to return accounts in all statuses."),
      page_size: z
        .number()
        .int()
        .min(1)
        .max(100)
        .default(50)
        .describe("Number of results per page (max 100)."),
    };
  • The async handler function that calls LinkedIn API GET /adAccounts with optional status filter and page size.
    export async function listAdAccounts(args: {
      status?: string;
      page_size?: number;
    }) {
      const params: Record<string, string | number> = {
        q: "search",
        pageSize: args.page_size ?? 50,
      };
      if (args.status) {
        params["search"] = `(status:(values:List(${args.status})))`;
      }
      return liGet("/adAccounts", params);
    }
  • Import of the helper function liGet used to make the LinkedIn API GET request.
    import { liGet, resolveAdAccount, unwrapURN, urn } from "../client.js";
Behavior3/5

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

No annotations are provided, so the description carries full burden. It adequately describes the tool as a read-only list operation, details the returned data, and mentions filtering. However, it does not disclose pagination behavior beyond the page_size parameter, rate limits, or authentication specifics beyond 'authenticated user.'

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 brief (two sentences plus a filter note), front-loaded with the core purpose, and every sentence adds value. There is no redundancy or unnecessary detail.

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

Completeness4/5

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

Given no output schema or annotations, the description covers the tool's purpose, return fields, usage context, and parameter options. It lacks details on cursor-based pagination or error handling, but for a simple list tool with two optional params, it is sufficiently complete.

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%, so baseline is 3. The description reiterates the status filter and its options (including the default of showing all statuses when omitted), which adds marginal context but doesn't significantly supplement the schema.

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 all LinkedIn ad accounts accessible to the user, specifies returned fields (ID, name, status, currency, type, reference organization URN), and distinguishes itself from siblings like li_get_account by focusing on listing multiple accounts.

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

Usage Guidelines5/5

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

The description explicitly advises 'Use this first to discover the ad_account_id needed by other tools,' providing clear guidance on when to use this tool. It also explains the optional status filter and its effect.

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/ZLeventer/linkedin-campaign-manager-mcp'

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