api_login
Authenticate API requests by calling a login endpoint, extracting the token from the JSON response, and storing it in default headers for subsequent calls.
Instructions
Call a login endpoint, extract a token from the JSON response via tokenPath (dot path, e.g. "data.token"), and store it into defaultHeaders for all subsequent api_request/api_assert calls. Fails loudly if the token path is not found.
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": {
"url": "<url>"
},
"name": "api_login"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Login endpoint, absolute or relative to baseUrl | |
| body | No | Login credentials, e.g. {username, password} | |
| method | No | ||
| tokenPath | No | Default "token" | |
| headerName | No | Default "Authorization" | |
| headerPrefix | No | Default "Bearer " |