Neurology · LIVE
Migraine Treatment Optimization Questionnaire-4 (mTOQ-4)
mTOQ-4
Sum four caller-assigned Lipton 2015 mTOQ-4 frequency items and return the 0-8 total and published treatment-efficacy bands.
Markdown: /docs/mtoq-4.md · Canonical: https://magentlab.com/docs/mtoq-4
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum four caller-assigned Lipton 2015 mTOQ-4 frequency items and return the 0-8 total and published treatment-efficacy bands.
When to use
When an agent has already assigned the four Lipton 2015 frequency tokens and needs the published mTOQ-4 total and efficacy band, not a migraine diagnosis, abortive-drug order, or patient interview.
When not to use
- Not a medical device and not a diagnosis.
- Not an abortive-drug order.
- magent does not interview the patient.
- pain_free_2h, sustained_24h, able_to_plan, and in_control are caller-assigned Lipton 2015 frequency tokens (never=0, rarely=0, less_than_half=1, half_or_greater=2). magent does not assign the frequencies.
- This is the 4-item Lipton 2015 instrument only (table e-1 / methods cuts very_poor 0, poor 1-5, moderate 6-7, maximum 8). magent does not score the 19-item or 6-item mTOQ.
Formula
mTOQ-4 = pain_free_2h + sustained_24h + able_to_plan + in_control; each never=0, rarely=0, less_than_half=1, half_or_greater=2; max 8; very_poor=0, poor=1-5, moderate=6-7, maximum=8
Citation
- Title
- Ineffective acute treatment of episodic migraine is associated with new-onset chronic migraine
- Authors
- Lipton RB, Fanning KM, Serrano D, Reed ML, Cady R, Buse DC
- Source
- Neurology. 2015;84(7):688-695
Worked example
All four never
Given:
able_to_plan=neverin_control=neverpain_free_2h=neversustained_24h=never
- pain_free_2h never 0 + sustained_24h never 0 + able_to_plan never 0 + in_control never 0
- Score = 0 (max 8); treatment_efficacy very_poor
Three half_or_greater, one never
Given:
able_to_plan=half_or_greaterin_control=neverpain_free_2h=half_or_greatersustained_24h=half_or_greater
- pain_free_2h 2 + sustained_24h 2 + able_to_plan 2 + in_control never 0
- Score = 6 (max 8); treatment_efficacy moderate
All four half_or_greater
Given:
able_to_plan=half_or_greaterin_control=half_or_greaterpain_free_2h=half_or_greatersustained_24h=half_or_greater
- pain_free_2h 2 + sustained_24h 2 + able_to_plan 2 + in_control 2
- Score = 8 (max 8); treatment_efficacy maximum
Also searched as
- mTOQ-4
- Migraine Treatment Optimization Questionnaire
- Lipton mTOQ
- migraine treatment optimization
- mTOQ 4 item
- acute migraine treatment efficacy
- mTOQ-4 score
- Lipton 2015 mTOQ-4
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/mtoq_4?pain_free_2h=never&sustained_24h=never&able_to_plan=never&in_control=never
Full URL: https://api.magentlab.com/api/calc/mtoq_4?pain_free_2h=never&sustained_24h=never&able_to_plan=never&in_control=never
Call
Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params
return HTTP 400 before any quote or charge.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/mtoq_4?pain_free_2h=never&sustained_24h=never&able_to_plan=never&in_control=never"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pain_free_2h |
string | required · never, rarely, less_than_half, half_or_greater | Caller-assigned Lipton 2015 mTOQ-4 item 1. After taking your migraine medication, are you pain-free within 2 hours for most attacks? never=0, rarely=0, less_than_half=1, half_or_greater=2. magent does not interview the patient. |
sustained_24h |
string | required · never, rarely, less_than_half, half_or_greater | Caller-assigned Lipton 2015 mTOQ-4 item 2. Does one dose of your migraine medication usually relieve your headache and keep it away for at least 24 hours? never=0, rarely=0, less_than_half=1, half_or_greater=2. magent does not interview the patient. |
able_to_plan |
string | required · never, rarely, less_than_half, half_or_greater | Caller-assigned Lipton 2015 mTOQ-4 item 3. Are you comfortable enough with your migraine medication to be able to plan your daily activities? never=0, rarely=0, less_than_half=1, half_or_greater=2. magent does not interview the patient. |
in_control |
string | required · never, rarely, less_than_half, half_or_greater | Caller-assigned Lipton 2015 mTOQ-4 item 4. After taking your migraine medication, do you feel in control of your migraines enough so that you feel you can return to normal function? never=0, rarely=0, less_than_half=1, half_or_greater=2. magent does not interview the patient. |
Bulk (POST)
POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.
- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
- HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
- Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
- x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.
Example request (fixture)
{
"items": [
{
"able_to_plan": "never",
"in_control": "never",
"pain_free_2h": "never",
"sustained_24h": "never"
},
{
"able_to_plan": "never",
"in_control": "never",
"pain_free_2h": "never",
"sustained_24h": "never"
}
]
}
Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.
Example 200 (fixture)
{
"count": 2,
"path": "/api/calc/mtoq_4",
"items": [
{
"components": [
{
"value": "never",
"factor": "pain_free_2h",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "sustained_24h",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "able_to_plan",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "in_control",
"points": 0,
"present": true
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Lipton RB, Fanning KM, Serrano D, Reed ML, Cady R, Buse DC",
"doi": "10.1212/WNL.0000000000001256",
"id": "lipton-2015",
"pmid": "25616416",
"source": "Neurology. 2015;84(7):688-695",
"title": "Ineffective acute treatment of episodic migraine is associated with new-onset chronic migraine"
},
"formula": "mtoq_4",
"formula_expression": "mTOQ-4 = pain_free_2h + sustained_24h + able_to_plan + in_control; each never=0, rarely=0, less_than_half=1, half_or_greater=2; max 8; very_poor=0, poor=1-5, moderate=6-7, maximum=8",
"max_score": 8,
"score": 0,
"treatment_efficacy": "very_poor"
},
{
"components": [
{
"value": "never",
"factor": "pain_free_2h",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "sustained_24h",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "able_to_plan",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "in_control",
"points": 0,
"present": true
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Lipton RB, Fanning KM, Serrano D, Reed ML, Cady R, Buse DC",
"doi": "10.1212/WNL.0000000000001256",
"id": "lipton-2015",
"pmid": "25616416",
"source": "Neurology. 2015;84(7):688-695",
"title": "Ineffective acute treatment of episodic migraine is associated with new-onset chronic migraine"
},
"formula": "mtoq_4",
"formula_expression": "mTOQ-4 = pain_free_2h + sustained_24h + able_to_plan + in_control; each never=0, rarely=0, less_than_half=1, half_or_greater=2; max 8; very_poor=0, poor=1-5, moderate=6-7, maximum=8",
"max_score": 8,
"score": 0,
"treatment_efficacy": "very_poor"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | mtoq_4 |
formula_expression |
string | Exact expression used |
score |
integer | mTOQ-4 points 0-8 |
max_score |
integer | 8 |
treatment_efficacy |
string | Lipton 2015 efficacy band: very_poor (0), poor (1-5), moderate (6-7), or maximum (8). Not a diagnosis. |
components |
array | Per-item caller-assigned points |
citation |
object | Lipton et al. Neurology 2015 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": "never",
"factor": "pain_free_2h",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "sustained_24h",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "able_to_plan",
"points": 0,
"present": true
},
{
"value": "never",
"factor": "in_control",
"points": 0,
"present": true
}
],
"disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
"citation": {
"authors": "Lipton RB, Fanning KM, Serrano D, Reed ML, Cady R, Buse DC",
"doi": "10.1212/WNL.0000000000001256",
"id": "lipton-2015",
"pmid": "25616416",
"source": "Neurology. 2015;84(7):688-695",
"title": "Ineffective acute treatment of episodic migraine is associated with new-onset chronic migraine"
},
"formula": "mtoq_4",
"formula_expression": "mTOQ-4 = pain_free_2h + sustained_24h + able_to_plan + in_control; each never=0, rarely=0, less_than_half=1, half_or_greater=2; max 8; very_poor=0, poor=1-5, moderate=6-7, maximum=8",
"max_score": 8,
"score": 0,
"treatment_efficacy": "very_poor"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_mtoq4 |
mTOQ-4 items must each be never, rarely, less_than_half, or half_or_greater (Lipton 2015). Returned before settlement; you are not charged. |
| 400 | invalid_items |
POST body must be a JSON object with only an items array Returned before settlement; you are not charged. |
| 400 | invalid_item_count |
items must be an array of 1 to 25 objects Returned before settlement; you are not charged. |
| 400 | invalid_item |
each items entry must be a JSON object Returned before settlement; you are not charged. |
Related tools
- MIDAS — Sum five caller-assigned MIDAS day counts over the last 3 months and return the 0-450 total and published grades I–IV.
- Modified Rankin — Return the van Swieten 1988 modified Rankin handicap grade 0-5 from a caller-assigned integer, with the published grade wording.
Payment
Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64
PAYMENT-REQUIRED
header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /docs/mcp.
Guarantees
- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.