Skip to main content
Glama

traffic_incidents

Retrieve current Singapore road incidents like accidents, roadworks, and heavy traffic. Updates every 2 minutes to help plan routes and avoid delays.

Instructions

Get current road incidents including accidents, roadworks, and heavy traffic. Updates every 2 minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'traffic_incidents' tool. Fetches current road incidents data from the LTA DataMall API using axios and returns the JSON response or an error message.
    case "traffic_incidents": {
      try {
        const response = await axios.get('https://datamall2.mytransport.sg/ltaodataservice/TrafficIncidents', {
          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;
      }
    }
  • Tool schema definition for 'traffic_incidents', including name, description, and input schema (no required parameters).
    {
      name: "traffic_incidents",
      description: "Get current road incidents including accidents, roadworks, and heavy traffic. Updates every 2 minutes.",
      inputSchema: {
        type: "object",
        properties: {} // No parameters needed
      }
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arjunkmrm/mcp-sg-lta'

If you have feedback or need assistance with the MCP directory API, please join our Discord server