Skip to main content
Glama

Add reward budget to a Performance ad

top_up_ad
Idempotent

Performance ads. Adds reward budget to an ad; the platform fee is added on top. Paid from the balance, or the result is isError with the x402 PaymentRequired object: sign it and call again with the same arguments, the returned idempotency_key and the payment.

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": {
      "ad_id": "<ad_id>",
      "reward_budget_usd": "<reward_budget_usd>"
    },
    "name": "top_up_ad"
  }
}

Input Schema

NameRequiredDescriptionDefault
ad_idYesThe id of an ad of this account.
api_keyNoThe API key of the account (can_live_...). Optional when this MCP connection sends it as the Authorization: Bearer header.
idempotency_keyNoOnly to REPEAT an earlier call of this tool (a lost answer, a payment still confirming): the idempotency_key that call returned. Leave it out for a new call; the server then makes a random one and returns it.
payment_signatureNoThe x402 PaymentPayload for the requirement an earlier call of this tool returned, as base64-encoded JSON (the value of an HTTP PAYMENT-SIGNATURE header). An x402-aware MCP client sends the payload in _meta["x402/payment"] instead and leaves this out.
reward_budget_usdYesDecimal string with at most two decimals, before the fee.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, destructiveHint=false and openWorldHint=true; the description adds genuinely non-structured behavior: a real monetary charge with a fee on top, funding from balance, and the exact 402-style failure/retry contract. It does not say whether the added budget is reversible or refundable, what the minimum charge is, or what happens if the payment stays unconfirmed, which keeps it below a 5.

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?

Compact and front-loaded: the resource is named first and the payment/retry contract follows. Minor deductions for the dangling opening fragment 'Performance ads.' and the typo 'the result is isError', which slightly slows parsing of an otherwise dense, information-rich passage.

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 5-parameter mutation tool with no output schema, the description covers the essentials an agent needs to call it correctly: cost model, funding source, and the full payment-retry loop including reuse of the returned idempotency_key. Missing only secondary detail such as failure modes when a payment never confirms and whether the mutation can be undone.

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 100%, so ad_id, api_key, idempotency_key, payment_signature and reward_budget_usd are all already documented in the schema, including the decimal-string format and the 'repeat an earlier call' semantics. The description adds nothing about individual parameters beyond echoing the fee context for the budget amount, so the baseline 3 applies.

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?

States a concrete verb and resource: 'Adds reward budget to an ad', plus the notable qualifier that the platform fee is added on top. That is far more specific than the title alone, though it never distinguishes itself from the adjacent money-adjacent siblings (quote_ad, buy_ad_credit), so an agent must infer the boundary from names.

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?

Gives clear operational context: the charge is drawn from the balance when possible, and otherwise the call returns isError with an x402 PaymentRequired object that must be signed and re-submitted with the same arguments plus the returned idempotency_key and the payment. This is a usable when/how path, but there is no explicit statement of when to prefer this tool over quote_ad or buy_ad_credit, and no prerequisites spelled out.

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