LinkedIn Ads ACTION
Create A Report
Queries the Analytics Finder to get analytics for the specified entity i.e company, account, campaign. See the docs here
- Action
- Read only
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's LinkedIn Ads account once, then configure and run Create A Report from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "linkedin_ads-create-report",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
linkedin_ads: { authProvisionId: "apn_xxxxxxx" },
adAccountId: "Ad Account Id",
pivot: "Pivot",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "linkedin_ads-create-report",
"configured_props": {
"linkedin_ads": { "authProvisionId": "apn_xxxxxxx" },
"adAccountId": "Ad Account Id",
"pivot": "Pivot"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "linkedin_ads",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "linkedin_ads-create-report",
arguments: {
adAccountId: "Ad Account Id",
pivot: "Pivot",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
adAccountId Ad Account Id | string | Sponsored ad account id to match results by Required Dynamic |
pivot Pivot | string | Pivot of results, by which each report data point is grouped. The following enum values are supported:
Required |
timeGranularity Time Granularity | string | Time granularity of results. Valid enum values:
Required |
dateRangeStart Date Range Start | string | Represents the inclusive start time range of the analytics. If unset, it indicates an open range up to the end time. Should be in the ISO 8601 format, e.g. 2022-12-27. Required |
dateRangeEnd Date Range End | string | Represents the inclusive end time range of the analytics. Must be after start time if it's present. If unset, it indicates an open range from start time to everything after. Should be in the ISO 8601 format, e.g. 2022-12-27. Optional |
shares Shares | string[] | An Array of Share URN. Required unless another facet is provided. Optional |
campaigns Campaigns | string[] | An Array of Sponsored Campaign URN. Required unless another facet is provided. Optional |
creatives Creatives | string[] | An Array of Sponsored Creative URN. Required unless another facet is provided. Optional |
campaignGroups Campaign Groups | string[] | An Array of Campaign Group URN. Required unless another facet is provided. Optional |
accounts Accounts | string[] | An Array of Account URN. Required unless another facet is provided. Optional Dynamic |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- linkedin_ads-create-report
- Version
- 0.0.8
- App
- LinkedIn Ads
- Authentication
- OAuth
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗