MCP tools
The tools are listed in the order tools/list gives them. Each tool’s description starts with
what a call costs and ends with the tool to call next. Every argument has a description, and every
tool has an output schema. The server’s instructions and get_catalog set out the rules all the
tools share: coordinates, keys, reason codes and what to quote. travel_times lists every
amenity type in its description, and the other tools take the same names.
| Tool | Arguments | Result |
|---|---|---|
travel_times |
lat and lon, or points (1–100, each with an optional label); optional modes, period, statistic, types, include, walk_budget, lang |
Minutes per type and mode, {type: {mode: {minutes, reason}}}, with basis, links.map and meta. modes takes walk (default), bike, transit and bike_transit; to see every option without a car, ask for walk, bike and transit in one call. A point counts as one request, whatever the modes. period and statistic are for the transit modes, as in cycling and transit. A transit entry can be fell_back (no transit reaches the point: the walk or ride, with fell_back_to and a note) or walk_faster (no transit trip beats walking: the walking time). The answer gives the modes it can, and lists the others, such as bike_transit without a key, in unavailable_modes; the call fails only when it can answer no mode. include (one point only) adds place and population, and where the routing service is on, walk_counts: places reached on foot within walk_budget, routed from the point, with walk_pois. points needs a key. Its answer has compact rows (a number when the time is ok), one links.map_template with {lat} and {lon}, and meta once. Failed points, and points outside Canada, are in errors. When the day’s allowance covers only some points, the answer has truncated and truncated_reason. |
nearby_places |
lat, lon, optional types, lang, picture |
As with /v1/compass, the answer gives, by default for each of the eight everyday trips, its label, the nearest place with its walking minutes and direction, then the next places within 30 minutes. types may also ask for school, elementary_school, secondary_school, childcare, playground or hospital where the data has them; elsewhere the server refuses the call and lists the types it has. An unnamed place has name: null. basis says the minutes are from the H3 cell the point stands in. links.map opens the map at the point with its compass. With picture: true the answer includes the compass as an image (PNG) and a link to /v1/compass.png, for one request more. When the server can’t draw the picture, a line of text says why. |
walking_routes |
lat, lon, types (one to five) |
As /v1/routes: the walked path to the nearest place of each type, with the seconds at each vertex. Needs a key. Each type routed counts as one request. Listed only where the routing service is on. |
find_place |
name, optional province; where the routing service is on, optional lat and lon (together) and walk_budget |
Up to five Canadian towns with their centre, prov and population. name can be written as people write it (“Toronto, ON”, “Quebec City”, “St-Jérôme”); when no town matches, detail says what to give. With a key and a point, the answer also has named places reached on foot within walk_budget minutes (default 15) of the point. |
get_catalog |
{} |
The amenity types with English and French labels, the everyday trips, the modes and where each works, the periods in words, the statistics, the reason codes, what needs a key and what is free, the rule for named places, coverage (with the types nearby_places answers here), the method and how to cite it. |
account_status |
{} |
The connection’s tier, daily limit and remaining requests, key_unlocks, free_without_key, and, where the Reach tools are listed, reach: whether this connection may ask Reach, the answers left today, or why not (anonymous, no_account, not_member, daily_limit, unavailable). |
start_sign_in |
optional name (shown on the approval page) |
A link and code for the person to approve, and a device_code for check_sign_in. |
check_sign_in |
device_code |
status: pending, slow_down, denied, expired, or approved with api_key (once; later calls get already_issued). |
Where the routing service is on, the server offers walking_routes, walk_counts, walk_pois and
the name search near a point; aportee://coverage says where it is on. The nearest one to three
named places of each everyday trip are free in nearby_places, and, where routing is on, in
travel_times with walk_counts. Searching places by name near a point and walking routes need a
key.
Results
Section titled “Results”Tool results include structuredContent and the same JSON as a text block. Every answer about
places has the same meta: data_version and data_date, attribution (with transit it credits
the operators and links their notices) and method_url. travel_times adds limit_minutes (60:
a type not reached within it is no_access), timetables with transit, and reasons, what each
reason code in the answer means. The method, the census year and the citation are in get_catalog
and aportee://method. When under a tenth of the day’s requests remain, an answer adds quota.
A refused call sets isError: true and includes the API’s error body, worded
with tool and argument names, and with next on a refusal that needs a key. The server refuses an
argument of the wrong type in plain text, before the tool runs.
Tools count against the same daily limits as their REST equivalents
(rate limits), except that travel_times counts one request
per point whatever the modes; get_catalog, account_status, start_sign_in, check_sign_in and
protocol initialization are not counted. Counted tools return the remaining quota and reset time
in _meta["ca.aportee/rate-limit"]. The server treats an unrecognized key as no key.
Resources
Section titled “Resources”The server offers three resources, as JSON:
aportee://catalog: the same asget_catalog.aportee://coverage: where points, routed walk counts and transit times exist, and the typesnearby_placesanswers.aportee://method: how the times are found, their limits and how to cite them.
Three tools answer Reach’s questions for members: whether a trip fits its time, the area within
reach of a place, and where two to four people could meet. They need a member’s own key, from a
free account that start_sign_in sets up from the chat. A key issued without an account doesn’t
open them.
Each call counts as one Reach answer, 50 a day per account, apart from the API’s daily requests.
Refusals are not counted, and each answer gives the answers left today in allowance. The three
tools read one day’s timetables at the times given: they take a day, and the modes transit,
bike and walk. period, statistic and bike_transit belong to the other tools.
Answers are a few kilobytes, with no geometry: numbers, a summary in English or French in the
map’s own words, a map link that opens the same trip, area or meeting, and meta with the
timetables’ day. get_catalog names the transit regions the tools cover.
| Tool | Arguments | Result |
|---|---|---|
check_trip |
from, to (left out for a round trip), depart, arrive (HH:MM, at most 300 minutes apart), optional day, mode, max_transfers, stop (a point with its stay_minutes) or stop_types with stay_minutes, lang |
fits, with spare_minutes, or short_minutes and fastest_minutes. By transit, on how many of seven departures (every 3 minutes, from 9 minutes before to 9 after) the trip fits, and the worst of them. Between two regions joined by a ferry or train, it checks the given departure only. With stop, when to be there and each leg’s fastest minutes; with stop_types, the places of each type with the most time to stop. |
reach_area |
lat, lon, optional modes, minutes (5 to 120), time, types, lang |
For each mode, the area in km², how many places of each type are within it and the nearest few. By transit, the typical area over seven departures and the worst case. The answer lists in unavailable_modes any mode refused while others answered. |
find_meeting_area |
people (two to four, each with lat, lon, and an optional mode and label), depart, arrive, optional day, together_minutes (5, 15 or 30), types, lang |
Whether they can meet, the longest time together, the area in km², and the places of each type with the time they could share there. |
A refusal says what to do next:
aportee.api.unauthorized: callstart_sign_in.aportee.api.rate_limited: the day’s answers or this minute’s requests are used up; waitretry_after_seconds.aportee.reach.warming: the routing service is loading the region; ask again afterretry_after_seconds.aportee.reach.unavailable: the routing service did not answer; retry afterretry_after_seconds.aportee.reach.no_transit: ask again bywalkorbike.aportee.reach.different_regions:find_meeting_areaneeds everyone in one routing region.aportee.api.outside_coverageandaportee.api.no_street_nearby:hintsays what to try, such as swappinglatandlon.