When a batch operation runs out of tokens mid-way, MoltSets returns partial results rather than failing the entire call. The response includes whatever was processed successfully, along with metadata describing what was dropped and why.
{
"jsonrpc": "2.0",
"id": null,
"result": {
"content": [
{
"type": "text",
"text": "{\"results\":[],\"metadata\":{\"total_requested\":60,\"total_processed\":50,\"total_with_data\":50,\"total_dropped\":10,\"drop_reason\":\"insufficient_credits\",\"credits_charged\":50,\"credits_remaining\":0},\"error\":{\"code\":\"insufficient_credits\",\"message\":\"10 results dropped due to insufficient credits. Balance: 0.\"}}"
}
],
"isError": false
}
}Your agent loop should check for error.code: "insufficient_credits" and surface metadata.total_dropped and metadata.credits_remaining to the user β don't discard the partial results. The user can top up at https://app.moltsets.com and resume from where the operation stopped.
