Query train stations Beta

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://bump.sh/bump-examples/doc/train-travel-api/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Train Travel API MCP server": {
    "url": "https://bump.sh/bump-examples/doc/train-travel-api/mcp"
  }
}

Close
QUERY /stations

Returns a paginated and searchable list of train stations.

Uses the HTTP QUERY method: filter criteria are sent in the request body (safe and idempotent, like GET, but without putting search terms in the URL).

Query parameters

  • page integer

    The page number to return

    Minimum value is 1. Default value is 1.

  • limit integer

    The number of items to return per page

    Minimum value is 1, maximum value is 100. Default value is 10.

application/json

Body

  • coordinates string

    The latitude and longitude of the user's location, to narrow down the search results to sites within a proximity of this location.

  • country string(iso-country-code)

    Filter stations by country code

Responses

  • OK

    Hide headers attributes Show headers attributes
    • Cache-Control

      A comma-separated list of directives as defined in RFC 9111.

    • RateLimit

      The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • data array[object]

      A train station.

    Hide response attributes Show response attributes object
    • data array[object]

      A train station.

  • Bad Request

    Hide headers attribute Show headers attribute
    • RateLimit

      The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Unauthorized

    Hide headers attribute Show headers attribute
    • RateLimit

      The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Forbidden

    Hide headers attribute Show headers attribute
    • RateLimit

      The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Too Many Requests

    Hide headers attributes Show headers attributes
    • RateLimit

      The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    • Retry-After

      The Retry-After header indicates how long the user agent should wait before making a follow-up request. The value is in seconds and can be an integer or a date in the future. If the value is an integer, it indicates the number of seconds to wait. If the value is a date, it indicates the time at which the user agent should make a follow-up request.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

  • Internal Server Error

    Hide headers attribute Show headers attribute
    • RateLimit

      The RateLimit header communicates quota policies. It contains a limit to convey the expiring limit, remaining to convey the remaining quota units, and reset to convey the time window reset time.

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

    Hide response attributes Show response attributes object
    • type string

      A URI reference that identifies the problem type

    • title string

      A short, human-readable summary of the problem type

    • detail string

      A human-readable explanation specific to this occurrence of the problem

    • instance string

      A URI reference that identifies the specific occurrence of the problem

    • status integer

      The HTTP status code

QUERY /stations
QUERY /stations?page=1&limit=10 HTTP/1.1
Host: api.example.com
Content-Type: application/json
Accept: application/json

{
  "coordinates": "52.5200,13.4050",
  "search": "Milano Centrale",
  "country": "DE"
}
import { TrainTravelSDK } from "train-travel-sdk";

const trainTravelSDK = new TrainTravelSDK({
  oAuth2: process.env["TRAINTRAVELSDK_O_AUTH2"] ?? "",
});

async function run() {
  const result = await trainTravelSDK.queryStations({
    stationQuery: {
      coordinates: "52.5200,13.4050",
      search: "Milano Centrale",
      country: "IT",
    },
  });

  console.log(result);
}

run();
import { TrainTravelSDK } from "train-travel-sdk";

const trainTravelSDK = new TrainTravelSDK({
  oAuth2: process.env["TRAINTRAVELSDK_O_AUTH2"] ?? "",
});

async function run() {
  const result = await trainTravelSDK.search.stations.queryStations({
    stationQuery: {
      coordinates: "52.5200,13.4050",
      search: "Milano Centrale",
      country: "IT",
    },
  });

  console.log(result);
}

run();
curl \
 --request QUERY 'https://try.microcks.io/rest/Train+Travel+API/1.0.0/stations' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "coordinates": "52.5200,13.4050",
  "search": "Milano Centrale",
  "country": "IT"
}'
Request example
{
  "coordinates": "52.5200,13.4050",
  "search": "Milano Centrale",
  "country": "IT"
}
Response examples (200)
A list of stations, closed to Milano Centrale
{
  "data": [
    {
      "id": "861dce35-2bc4-4b01-a91b-f267f1cfb59a",
      "name": "Milano Centrale",
      "address": "Piazza Ducca d'Aosta, 20214 Milano, Italy",
      "country_code": "IT",
      "timezone": "Europe/Milano"
    }
  ],
  "links": {
    "self": "https://api.example.com/stations?page=1"
  }
}
Response examples (200)
# Headers
Cache-Control: max-age=3600
RateLimit: limit=10, remaining=0, reset=10

# Payload
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <data type="array">
    <datum>
    </datum>
  </data>
  <links>
    <self>https://example.com</self>
    <next>https://example.com</next>
    <prev>https://example.com</prev>
  </links>
</root>
Response examples (400)
{
  "type": "https://example.com/errors/bad-request",
  "title": "Bad Request",
  "status": 400,
  "detail": "The request is invalid or missing required parameters."
}
Response examples (400)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/bad-request</type>
  <title>Bad Request</title>
  <status type="integer">400</status>
  <detail>The request is invalid or missing required parameters.</detail>
</root>
Response examples (401)
{
  "type": "https://example.com/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "You do not have the necessary permissions."
}
Response examples (401)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/unauthorized</type>
  <title>Unauthorized</title>
  <status type="integer">401</status>
  <detail>You do not have the necessary permissions.</detail>
</root>
Response examples (403)
{
  "type": "https://example.com/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Access is forbidden with the provided credentials."
}
Response examples (403)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/forbidden</type>
  <title>Forbidden</title>
  <status type="integer">403</status>
  <detail>Access is forbidden with the provided credentials.</detail>
</root>
Response examples (429)
{
  "type": "https://example.com/errors/too-many-requests",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "You have exceeded the rate limit."
}
Response examples (429)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/too-many-requests</type>
  <title>Too Many Requests</title>
  <status type="integer">429</status>
  <detail>You have exceeded the rate limit.</detail>
</root>
Response examples (500)
{
  "type": "https://example.com/errors/internal-server-error",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An unexpected error occurred."
}
Response examples (500)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <type>https://example.com/errors/internal-server-error</type>
  <title>Internal Server Error</title>
  <status type="integer">500</status>
  <detail>An unexpected error occurred.</detail>
</root>