Try a RailCore API endpoint
try_endpointSend one real request to a RailCore API read endpoint with your account and return its answer: status, request ID, requests counted and left, and the response body. It counts against your plan like any API request, so ask the user first. max_requests caps what it may count (default 1); a request that would count more is refused before it is sent. At most 30 tries an hour. Requires sign-in to your RailCore account. The first try also asks permission to make test requests.
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": {
"endpoint": "<endpoint>"
},
"name": "try_endpoint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | The JSON body as text, for the two POST endpoints only (batch-seat-availability, compare-journeys), such as {"journeys": [{"from": "BSL", "to": "ADI", "date": "2026-12-01"}]}. | |
| params | No | Path and query parameters by name, every value as a string, such as {"q": "pune", "limit": "5"} or {"train_number": "12951"}. Dates as YYYY-MM-DD. | |
| endpoint | Yes | A read endpoint: an id (search-stations), a method and path (GET /stations/search) or a URL. | |
| max_requests | No | The most requests this try may count, 1 to 25. Default 1. Raise it only after the user agrees to the cost. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| url | Yes | The public URL of the same request. | |
| method | Yes | ||
| status | Yes | ||
| docs_url | Yes | ||
| body_json | Yes | The response body as text, cut near 32 KB. | |
| truncated | Yes | ||
| error_code | No | ||
| request_id | No | ||
| endpoint_id | Yes | ||
| error_message | No | ||
| quoted_requests | Yes | What this request was expected to count, before it was sent. | |
| requests_counted | No | From X-RailCore-Credits-Cost. | |
| requests_remaining | No | From X-RailCore-Credits-Remaining. |