carpark_availability
Check real-time parking lot availability for HDB, LTA, and URA carparks in Singapore, updated every minute through the LTA MCP Server integration.
Instructions
Get real-time availability of parking lots for HDB, LTA, and URA carparks. Updates every minute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:238-265 (handler)The switch case handler for the 'carpark_availability' tool. It fetches real-time car park availability data from the LTA DataMall API (CarParkAvailabilityv2 endpoint) using axios, returns the JSON response as text content, or an error message if the API call fails.case "carpark_availability": { try { const response = await axios.get('https://datamall2.mytransport.sg/ltaodataservice/CarParkAvailabilityv2', { headers: { 'AccountKey': process.env.LTA_API_KEY!, 'accept': 'application/json' } }); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `LTA API error: ${error.response?.data?.Message ?? error.message}` }], isError: true }; } throw error; } }
- src/index.ts:90-97 (registration)Registration of the 'carpark_availability' tool in the list tools response, including name, description, and input schema (no parameters required). Also serves as the schema definition.{ name: "carpark_availability", description: "Get real-time availability of parking lots for HDB, LTA, and URA carparks. Updates every minute.", inputSchema: { type: "object", properties: {} // No parameters needed } },