Skip to content

Docs

The MCP tools

The MCP server is at https://mcp.paygynt.com/mcp. It acts only on Paygynt, and only for the agent that is connected.

Finding and buying

search_offerings

Read only

Search what the agent may buy, within its rules.

InputWhat it is
qWords to search for, such as weather forecast.
categoryA category, such as data, or a type, such as data.geo.
kindFixed price, by time or by units.
regionWhere it runs.
seller_idOne seller's offerings.
sortrelevance, price_asc or price_desc.
limitHow many to give back.

Gives back Offerings and their plans. A plan says if it is over_budget or needs_approval; an offering says if the agent has a task_in_progress with it.

get_quote

Read only

Price a purchase, or an extension of a task. Valid for 5 minutes.

InputWhat it is
variant_idThe plan to buy, for a new purchase.
quantityrequiredHow much, such as 10 calls.
extendsA task's latest hold_id, to extend that task instead.

Gives back A quote_id and the price, with tax and fee estimates.

place_hold

Changes something

Buy what a quote priced, setting the money aside from the budget.

InputWhat it is
quote_idrequiredFrom get_quote.
idempotency_keyrequiredA unique string for this purchase. The same one retries it safely.
notify_at_percentSend extension_due when this much is used. 0 sends none.
notify_at_secondsOr send it this long before the limit.

Gives back The hold_id, the task_id and the token to call the service with. Over the approval amount: the error needs_approval, with an approval_id.

get_approval

Read only

See whether a purchase waiting for approval was approved.

InputWhat it is
approval_idrequiredFrom the needs_approval error.

Gives back pending while it waits; once approved, the hold, the task and the token.

Running tasks

get_task

Read only

A task: what it has used, its status, and a fresh token.

InputWhat it is
task_idrequiredThe task.

Gives back Its holds, units used, status, whether an extension is due, and a fresh token.

decline_extension

Cannot be undone

Say no extension is coming, so the task ends at its limit.

InputWhat it is
task_idrequiredThe task.

Gives back The task.

release_hold

Cannot be undone

End a task, or one hold, early. What is unused goes back to the budget.

InputWhat it is
task_idThe task to end.
hold_idOr one hold to end.

Gives back What was released.

Budget and spending

get_budget

Read only

What is left to spend this month.

No inputs.

Gives back The monthly limit and what is left, the extra for finishing running tasks, and the company's card limit.

get_usage

Read only

The agent's bills and spending.

InputWhat it is
seller_idOne seller's.
statusBills in one status.

Gives back Bills with their lines, and spending by seller, offering and task.

flag_usage

Changes something

Question a line on a bill while the bill is in review.

InputWhat it is
invoice_line_idrequiredThe line.
reasonrequiredWhat looks wrong.

Gives back The flag.

Errors

A refused call is a tool error whose text is JSON: {"error": {"code": "…", "message": "…"}}

CodeWhat it meansWhat to do
over_budgetIt costs more than is left (remaining).Buy less, or ask your person to raise the limit.
not_allowedThe agent's rules do not allow it.Ask your person.
needs_approvalIt is over the approval amount.Tell your person, then check get_approval.
approval_declinedYour person said no.Do not buy it.
approval_expiredNobody answered within an hour.Ask again only if it is still needed.
quote_expiredThe quote is older than 5 minutes.Get a new quote.
task_in_progressThere is already a task with that offering.Use it: get_task.
seller_unavailableIt cannot be sold now.Find another.
search_unavailableSearch is down for a moment.Try again shortly.
unavailablePaygynt could not be reached.Retry with the same idempotency_key.