Skip to main content
Glama

Attach a dataset to an ad set

ads_ad_set_dataset

[writes · ads:manage scope] Attaches a Meta dataset (pixel) to an existing ad set, optionally with the conversion event (e.g. PURCHASE). Pass agentName and reason. Audited in Ads > Agent activity. It cannot be undone from there: to change it back, call this tool again with the earlier settings. (Wraps POST /api/v2/ads/ad-sets/{id}/dataset.)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>",
      "agentName": "<agentName>",
      "reason": "<reason>",
      "pixelId": "<pixelId>"
    },
    "name": "ads_ad_set_dataset"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
reasonYesWhy the agent is doing this. Shown to the owner and kept in the audit trail.
brandIdNoA brand id (GET /api/v2/brands) or "personal"; default: the key owner's active brand.
pixelIdYesThe Meta dataset (pixel) id, digits.
agentNameYesWhich agent is acting. Shown to the owner in Ads > Agent activity.
customEventTypeNoMeta standard event, e.g. PURCHASE, LEAD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the annotations, it discloses the required `ads:manage` scope, that the action is recorded in Ads > Agent activity, and that the change is not revertible from that log but can be reversed by re-calling with prior settings — meaningful operational context for a mutation. It does not say what happens to any dataset already attached, which is the one behavioral gap; note the 'cannot be undone' phrasing is about the audit log and is consistent with destructiveHint=false, not a contradiction.

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 scope/permission tag is front-loaded in brackets, followed by the action, the optional parameter, the audit consequence, and the revert path. Two sentences plus a wrapper note, with no redundant wording.

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?

For a 6-parameter mutation tool with no output schema, the description covers permissions, audit visibility, and reversibility, which is what an agent needs before acting. Minor omissions are the effect on any pre-existing dataset attachment and the brandId fallback behavior.

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 83%, so the schema already documents reason, agentName, pixelId, brandId, and customEventType. The description adds little beyond that: it restates that agentName and reason should be passed and that the conversion event is optional (e.g. PURCHASE), but says nothing about `id` or `brandId` defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first clause names a specific verb and resource ('Attaches a Meta dataset (pixel) to an existing ad set') and scopes it to an existing ad set, which separates it from creation-style siblings. It does not explicitly contrast with the closest sibling, ads_ad_set_placements, so an agent must infer that this tool is about pixels rather than placements.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: attach a pixel to an existing ad set, optionally with a conversion event. The description does supply a concrete re-use case ('to change it back, call this tool again with the earlier settings'), but it never says when not to use it or names an alternative sibling for related ad-set configuration.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources