Skip to main content
Glama
ZLeventer

linkedin-campaign-manager-mcp

li_get_conversion_performance

Fetch conversion performance per event type for LinkedIn campaigns. Compare cost-per-conversion, impressions, clicks, and spend across insight tag events. Scope to specific campaigns or account level.

Instructions

Fetch conversion performance broken down by conversion event (CONVERSION pivot). Returns externalWebsiteConversions, externalWebsitePostClickConversions, externalWebsitePostViewConversions, impressions, clicks, and spend per conversion event. Use to compare cost-per-conversion across event types, diagnose which Insight Tag events are driving value, or build a funnel from impression → click → conversion. Scope to specific campaigns or report at account level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idsNoCampaign numeric IDs or URNs to scope the conversion report. Omit for account-level.
ad_account_idNo
start_dateNoStart of date range. Accepts YYYY-MM-DD, today, yesterday, or NdaysAgo. Default: 28daysAgo.28daysAgo
end_dateNoyesterday
fieldsNoComma-separated metrics. Default: externalWebsiteConversions,externalWebsitePostClickConversions,externalWebsitePostViewConversions,impressions,clicks,costInUsd,costInLocalCurrency

Implementation Reference

  • src/index.ts:155-160 (registration)
    MCP server registration of the li_get_conversion_performance tool. Maps the tool name to the schema and handler function.
    server.tool(
      "li_get_conversion_performance",
      "Fetch conversion performance broken down by conversion event (CONVERSION pivot). Returns externalWebsiteConversions, externalWebsitePostClickConversions, externalWebsitePostViewConversions, impressions, clicks, and spend per conversion event. Use to compare cost-per-conversion across event types, diagnose which Insight Tag events are driving value, or build a funnel from impression → click → conversion. Scope to specific campaigns or report at account level.",
      getConversionPerformanceSchema,
      async (args) => { try { return ok(await getConversionPerformance(args)); } catch (e) { return err(e); } }
    );
  • Zod schema defining the input parameters for getConversionPerformance: campaign_ids, ad_account_id, start_date, end_date, fields.
    export const getConversionPerformanceSchema = {
      campaign_ids: z
        .array(z.string())
        .optional()
        .describe("Campaign numeric IDs or URNs to scope the conversion report. Omit for account-level."),
      ad_account_id: z.string().optional(),
      start_date: z
        .string()
        .default(DEFAULT_START)
        .describe("Start of date range. Accepts YYYY-MM-DD, today, yesterday, or NdaysAgo. Default: 28daysAgo."),
      end_date: z.string().default(DEFAULT_END),
      fields: z
        .string()
        .optional()
        .describe(`Comma-separated metrics. Default: ${CONVERSION_FIELDS}`),
    };
  • Handler function that builds a LinkedIn Ad Analytics API request with CONVERSION pivot, date range, fields, and optional campaign/account scoping, then returns raw API response via liGetRaw.
    export async function getConversionPerformance(args: {
      campaign_ids?: string[];
      ad_account_id?: string;
      start_date?: string;
      end_date?: string;
      fields?: string;
    }) {
      const start = resolveDate(args.start_date ?? DEFAULT_START);
      const end = resolveDate(args.end_date ?? DEFAULT_END);
      const fields = args.fields ?? CONVERSION_FIELDS;
    
      const campaignUrns = args.campaign_ids?.map((id) => urn("sponsoredCampaign", id));
      const accountUrn =
        campaignUrns && campaignUrns.length > 0
          ? undefined
          : resolveAdAccount(args.ad_account_id);
    
      const qs: string[] = [
        "q=statistics",
        "pivot=CONVERSION",
        "timeGranularity=ALL",
        `dateRange=${encodeURIComponent(dateRangeParam(start, end))}`,
        `fields=${fields}`,
      ];
      if (campaignUrns && campaignUrns.length > 0) {
        qs.push(`campaigns=${encodeURIComponent(`List(${campaignUrns.join(",")})`)}`);
      } else if (accountUrn) {
        qs.push(`accounts=${encodeURIComponent(`List(${accountUrn})`)}`);
      }
    
      const url = `${BASE_URL}/adAnalytics?${qs.join("&")}`;
      return liGetRaw(url);
    }
  • Default set of metric fields requested from the LinkedIn Analytics API for conversion performance.
    const CONVERSION_FIELDS = [
      "externalWebsiteConversions",
      "externalWebsitePostClickConversions",
      "externalWebsitePostViewConversions",
      "impressions",
      "clicks",
      "costInUsd",
      "costInLocalCurrency",
    ].join(",");
Behavior3/5

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

No annotations provided, so description carries full responsibility. It clearly states the operation is a read fetch and lists the returned metrics. However, it omits details like rate limits, data freshness, auth requirements, or any side effects. For a read-only tool, this is adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: core action first, then return fields, then use cases, then scoping. Each sentence adds value, though it could be slightly shorter. The front-loading is effective for quick agent parsing.

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, the description fairly explains return values by listing the metrics and their meaning. It also covers the pivot dimension. It does not mention pagination, data limits, or error handling, but for a report tool with moderate complexity, the coverage is mostly 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 description coverage is 60%. The description adds only minor repetition of scoping guidance for campaign_ids ('Scope to specific campaigns or report at account level'). It offers no additional meaning for parameters like ad_account_id, end_date, or fields beyond what is in the schema, and does not compensate for the 40% of parameters lacking schema descriptions.

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 specifies a clear verb ('Fetch'), resource ('conversion performance'), and unique breakdown ('by conversion event'). It lists specific metrics returned and provides concrete use cases (compare cost-per-conversion, diagnose event value, build funnel). This effectively distinguishes it from sibling campaign-performance tools.

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 states scoping options ('Scope to specific campaigns or report at account level') and describes when to use (comparing cost-per-conversion, diagnosing event value, building funnels). No explicit when-not-to-use or alternatives, but the guidance is sufficient for an agent to select this tool.

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