Skip to main content
Glama

create_batch

Run one operation for up to 100 targets as a background batch with one job per target, returning the batch immediately so results can be retrieved later.

Instructions

Run one operation for up to 100 targets at once as a background batch with one job per target, and return the batch right away. Uses credits for delivered results at the rate get_operation_guide shows (per result, or a flat amount for a few collections); credits are held at the start and the unused part is released, and failed, cancelled or empty runs are free. Use it instead of repeated extract_now or create_extraction calls when you have a list; for large lists run estimate_credits with target_count first. Returns idempotency_key and the batch (id, status, per-status counts, reserved_credits, billed_credits); follow with get_batch, then read each job with get_extraction_result. Safe to retry with the same idempotency_key.

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": {
      "platform": "<platform>",
      "operation": "<operation>",
      "targets": "<targets>"
    },
    "name": "create_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum results to collect per target, from 1 up to the operation's max_results in discover_platforms. Default 12. Single-item operations (profile, post, video, transcript, playlist, adlibrary_ad, adlibrary_ad_transcript, profile_analytics) always count as 1; Instagram highlights, highlight_items and stories ignore limit. Example: 50
targetsYesTargets to run the operation for, 1-100, each in the same format as target and up to 255 characters; duplicates (ignoring case) are rejected. Example: ["nike", "adidas"]
platformYesPlatform name from discover_platforms: instagram, tiktok, youtube, x or facebook. Example: instagram
operationYesOperation name from discover_platforms for the chosen platform, such as profile, posts, comments, followers, hashtag, search or adlibrary_search. Example: posts
include_postsNoOnly for operation profile: also return this many recent posts, 0 up to the posts operation's max_results (200 at most; 50 at most in extract_now), billed at the posts rate. Default 0. Example: 12
idempotency_keyNoOptional retry key, 1-128 characters. Repeating the call with the same key and identical arguments returns the original request instead of starting and charging a new one. Reusing a key with different arguments is rejected. Leave it out to get a generated key back as idempotency_key. Example: nike-posts-2026-12-01

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.1
    • addedInput schema / properties / idempotency_key / description
      Added value: +"Optional retry key, 1-128 characters. Repeating the call with the same key and identical arguments returns the original request instead of starting and charging a new one. Reusing a key with different arguments is rejected. Leave it out to get a generated key back as idempotency_key. Example: nike-posts-2026-12-01"
    • addedInput schema / properties / include_posts / description
      Added value: +"Only for operation profile: also return this many recent posts, 0 up to the posts operation's max_results (200 at most; 50 at most in extract_now), billed at the posts rate. Default 0. Example: 12"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum results to collect per target, from 1 up to the operation's max_results in discover_platforms. Default 12. Single-item operations (profile, post, video, transcript, playlist, adlibrary_ad, adlibrary_ad_transcript, profile_analytics) always count as 1; Instagram highlights, highlight_items and stories ignore limit. Example: 50"
    • changedInput schema / properties / operation / description
      Previous value: -"Operation returned by discover_platforms"New value: +"Operation name from discover_platforms for the chosen platform, such as profile, posts, comments, followers, hashtag, search or adlibrary_search. Example: posts"
    • changedInput schema / properties / platform / description
      Previous value: -"Platform returned by discover_platforms"New value: +"Platform name from discover_platforms: instagram, tiktok, youtube, x or facebook. Example: instagram"
    • addedInput schema / properties / targets / description
      Added value: +"Targets to run the operation for, 1-100, each in the same format as target and up to 255 characters; duplicates (ignoring case) are rejected. Example: [\"nike\", \"adidas\"]"
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description takes full responsibility for explanation. It explains the billing model: credits are reserved at the start and the unused part is released; failed, cancelled, or empty runs are free. It also states that the batch is asynchronous but returns immediately, and that retries are idempotent when the same key is used. That is unusually thorough for a credit-consuming mutation tool.

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 text is front-loaded with purpose, then cost, alternative tools, return value, and workflow, so each sentence adds distinct information. The cost sentence is dense and contains several clauses about holding and releasing credits, but those clauses are load-bearing rather than padding.

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?

There is no output schema, so the description must state the return values, and it does: idempotency_key plus batch details (id, status, per-status counts, reserved_credits, billed_credits). It also covers the asynchronous nature of the batch and how to collect results. Nothing an agent needs in order to call the tool or continue the workflow is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already explains each parameter. The description adds operational meaning to idempotency_key: a retry with the same key and identical arguments returns the original request instead of starting a new charge, and reusing the key with different arguments is rejected. It does not explain the semantics of target formatting or limits beyond what the schema already states, but its extra value on the retry key is real.

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 opens with a specific verb and resource ('Run one operation for up to 100 targets ... as a background batch with one job per target') and immediately states the return timing ('return the batch right away'). That distinguishes it from forward-looking tools such as create_extraction and extract_now, not just from get_batch.

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?

It names the exact alternatives it replaces ('instead of repeated extract_now or create_extraction calls when you have a list') and gives the condition that selects the alternative ('for large lists run estimate_credits with target_count first'). It also specifies the correct follow-up sequence: get_batch, then get_extraction_result for each job.

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