Skip to main content
Glama

Add to a collection

add_to_collection

Use when putting a Tracker into a Collection (id or name): by tracker_id, or by platform + target, which starts a Tracker if not tracked yet. Not for a focus or a refresh: track (its collection argument files it too). Price: Free for a Tracker you have; a new target runs its first cycle: creator 6, hashtag 3, keyword 3, sound 6, advertiser 30 credits; +20 credits per new video analysed. A new name creates the Collection with the Tracker's kind (pass kind with a target); another kind is collection_kind_mismatch. Collections mix Meta, Google and TikTok Advertisers.

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": {
      "collection": "<collection>"
    },
    "name": "add_to_collection"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoAdding by target: the Tracker's kind. Required for a new Collection.
targetNoHandle, hashtag, phrase (kind=keyword), sound id, Page id, or with platform tiktok or platform google an advertiser id, URL or name
estimateNoQuote the price in Credits: no Run, no charge
platformNoWith target, instead of tracker_id
collectionYesThe Collection, by id or name. A new name creates it, with the Tracker's kind.
tracker_idNoA Tracker you already have
max_creditsNo
intelligenceNoAnalyse new videos, when the target is not tracked yet

Output Schema

NameRequiredDescriptionDefault
runNoThe new Tracker's first cycle; null when nothing was created.
addedNoFalse when the Tracker was already a member (200), or, with `collection_error`, when the Collection was deleted before the new Tracker could join (201).
cachedNo
createdNoTrue when this call started tracking the target.
trackerNoThe member, as it now is, state included.
per_cycleNo
collectionNoAbsent only with `collection_error`.
tracker_idNo
already_trackingNo
collection_errorNoOnly when the Collection was deleted while the new Tracker's first cycle ran.
estimate_creditsNo
intelligence_runNoThe Run analysing the first cycle's new Ads (an advertiser Tracker with `intelligence.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / platform / enum
      Previous value: -[
      -  "tiktok",
      -  "instagram",
      -  "youtube",
      -  "facebook"
      -]New value: +[
      +  "tiktok",
      +  "instagram",
      +  "youtube",
      +  "facebook",
      +  "meta",
      +  "google"
      +]
    • changedInput schema / properties / target / description
      Previous value: -"Handle, hashtag, search phrase (kind=keyword), sound id, Page id, or with platform tiktok a TikTok ad library advertiser id, URL or name"New value: +"Handle, hashtag, phrase (kind=keyword), sound id, Page id, or with platform tiktok or platform google an advertiser id, URL or name"
  2. Changed2 schema fields changed
    • changedInput schema / properties / collection / description
      Previous value: -"The Collection, by id or name. A name you have not used yet creates it, with the Tracker's kind."New value: +"The Collection, by id or name. A new name creates it, with the Tracker's kind."
    • changedInput schema / properties / kind / description
      Previous value: -"Adding by target: the Tracker's kind. Required when the Collection does not exist yet."New value: +"Adding by target: the Tracker's kind. Required for a new Collection."
  3. Changed3 schema fields changed
    • changedInput schema / properties / estimate / description
      Previous value: -"Return the price, in Credits, without running the operation or creating a Run"New value: +"Quote the price in Credits: no Run, no charge"
    • changedOutput schema / properties / collection / additionalProperties
      Previous value: -trueNew value: +{}
    • removedOutput schema / properties / collection / properties
      Removed value: -{}
  4. Changed1 schema field changed
    • addedInput schema / properties / max_credits
      Added value: +{
      +  "minimum": 0,
      +  "type": "integer"
      +}
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "added": {
      +      "description": "False when the Tracker was already a member (200), or, with `collection_error`, when the Collection was deleted before the new Tracker could join (201).",
      +      "type": "boolean"
      +    },
      +    "already_tracking": {
      +      "type": "boolean"
      +    },
      +    "cached": {
      +      "type": "boolean"
      +    },
      +    "collection": {
      +      "additionalProperties": true,
      +      "description": "Absent only with `collection_error`.",
      +      "properties": {},
      +      "type": "object"
      +    },
      +    "collection_error": {
      +      "$ref": "#/properties/collection",
      +      "description": "Only when the Collection was deleted while the new Tracker's first cycle ran."
      +    },
      +    "created": {
      +      "description": "True when this call started tracking the target.",
      +      "type": "boolean"
      +    },
      +    "estimate_credits": {
      +      "type": "integer"
      +    },
      +    "intelligence_run": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/properties/collection"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The Run analysing the first cycle's new Ads (an advertiser Tracker with `intelligence."
      +    },
      +    "per_cycle": {
      +      "type": "boolean"
      +    },
      +    "run": {
      +      "anyOf": [
      +        {
      +          "$ref": "#/properties/collection"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "The new Tracker's first cycle; null when nothing was created."
      +    },
      +    "tracker": {
      +      "$ref": "#/properties/collection",
      +      "description": "The member, as it now is, state included."
      +    },
      +    "tracker_id": {}
      +  },
      +  "type": "object"
      +}
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare a non-readonly, non-idempotent, open-world mutation, and the description adds substantial context beyond them: a side effect (a Tracker is started for an untracked target), per-kind credit costs plus a per-video surcharge, and a named error outcome (collection_kind_mismatch). The only missing piece is what max_credits does when the quote exceeds it.

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

Conciseness3/5

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

Front-loaded with the correct routing sentence and free of filler, but the pricing block is written in dense shorthand ('creator 6, hashtag 3, keyword 3, sound 6, advertiser 30 credits; +20 credits per new video analysed') that reads more like a table dump than prose. It is appropriately sized for an 8-parameter cost-incurring mutation, yet the telegraphic style costs some readability.

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?

For a mutating, credit-charging tool, the description covers side effects, cost, error paths, and collection-creation semantics, and an output schema exists so return values need not be explained. Nothing essential for a correct call is missing apart from the minor max_credits gap.

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 88%, so the baseline is 3, and the description earns a bit more by stating the cross-field constraint that kind must accompany target for a new Collection and that platform + target replaces tracker_id. However max_credits remains undocumented in both schema and description, and estimate/max_credits interactions with the price paragraph are left implicit.

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?

States a specific verb and resource ('putting a Tracker into a Collection') and immediately enumerates the two supported addressing modes (tracker_id, or platform + target). It is clearly distinguishable from siblings such as create_collection, act_on_collection, and track, which are named.

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?

Explicitly gives a when-not rule ('Not for a focus or a refresh') and routes the agent to the correct alternative ('track (its collection argument files it too)'). It also covers the create-on-the-fly case, which is the main ambiguity an agent would face.

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