Advance a test letter: advance_test_letter
Test mode only. Moves a test letter one stage on: approves it if it waits for a person (TEST 02 declines, TEST 03 lapses), then printing, printed, posted and on record. TEST 05 and TEST 06 letters are held and released or declined by a sample reviewer; TEST 07 comes back to sender after it is on record. With fail_print, a letter queued, being printed or printed fails at the printer instead and its held credits come back. Nothing is printed or posted.
| MCP tool | advance_test_letter |
| REST | POST /v1/letters/{letter}/advance |
| CLI | atomside advance-test-letter |
| Key needs | Send (letters:send) |
| Changes anything | Yes. |
| Idempotency key | Not used. |
Example
A real call and its real answer, made against the API in test mode. A test runs it again and fails if the answer changes. Ids, keys and links are replaced with stand-ins.
A call that works
REST:
curl -X POST https://api.atomside.com/v1/letters/ltr_example000000006/advance \
-H "Authorization: Bearer $ATOMSIDE_API_KEY"
MCP:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "advance_test_letter",
"arguments": {
"letter": "ltr_example000000006"
}
}
}
CLI:
atomside advance-test-letter \
--letter ltr_example000000006
The answer (HTTP 200; over MCP, the same JSON is the result's structuredContent):
{
"letter": "ltr_example000000006",
"from": "queued",
"status": "printing",
"advanced": true,
"says": "Being printed, simulated.",
"next": "Call advance_test_letter again."
}
Input
Over REST, fields in the path go in the path, GET fields in the query string, and POST fields in the JSON body. Over MCP, every field is an argument of the tool.
{
"type": "object",
"properties": {
"letter": {
"type": "string",
"description": "The test letter id, ltr_…."
},
"fail_print": {
"description": "Rehearse a printer failure: the letter fails at the printer instead of moving on, as letter.failed, and its held credits come back.",
"type": "boolean"
}
},
"required": [
"letter"
],
"additionalProperties": false
}
Output
{
"type": "object",
"properties": {
"letter": {
"type": "string"
},
"from": {
"type": "string",
"enum": [
"quoted",
"waiting_for_approval",
"queued",
"printing",
"printed",
"posted",
"on_record",
"declined",
"lapsed",
"cancelled",
"held",
"failed",
"returned"
]
},
"status": {
"type": "string",
"enum": [
"quoted",
"waiting_for_approval",
"queued",
"printing",
"printed",
"posted",
"on_record",
"declined",
"lapsed",
"cancelled",
"held",
"failed",
"returned"
]
},
"advanced": {
"type": "boolean",
"description": "False when the letter has nowhere further to go."
},
"says": {
"type": "string",
"description": "A sentence to repeat to your person as it stands."
},
"next": {
"type": "string"
}
},
"required": [
"letter",
"from",
"status",
"advanced",
"says",
"next"
],
"additionalProperties": false
}
Refusals
Every refusal has the same shape. Branch on code, answer and retry; repeat say to your person.
| Code | Answer | Retry | HTTP | What to do next |
|---|---|---|---|---|
key_missing | no | after_fix | 401 | Send the key as "Authorization: Bearer as_test_…". Ask your person if you have none. |
key_not_valid | no | never | 401 | Ask your person for a new key. There is no link: we cannot say whose it was. |
scope_missing | no | after_person | 403 | Ask your person to give the key that permission. |
invalid_request | no | after_fix | 400 | Fix the field named in details.field. The same idempotency key is fine. |
rate_limited | no | at_time | 429 | Wait. The same idempotency key never sends twice. |
try_again_shortly | no | at_time | 503 | Try again after retry_after with the same idempotency key. |
account_expired | no | never | 401 | Start again with start_account if your person still wants this. |
connection_ended | no | after_person | 401 | Tell your person. To carry on, they connect Atomside again in your assistant. |
letter_not_found | no | after_fix | 404 | Check the id with list_letters. |
test_mode_only | no | never | 403 | Use a test key, or read the letter with get_letter. |
key_cannot_send | no | after_person | 403 | Give your person the quote to send, or the link to the key. |
not_found | no | after_fix | 404 | Check the name against the tool list or /v1/openapi.json. |