Skip to main content
Glama
arjunkmrm

Singapore LTA MCP Server

by arjunkmrm

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
      }
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, but description adds useful behavioral detail: it updates every 2 minutes. Discloses no destructive actions, which is fine for a read-only tool. Lacks output format details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no wasted words, front-loaded with key information. Very concise and effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, and description does not mention return format or structure. While adequate for a simple tool, an agent might need to know what fields are returned. Sibling tools may have more structured outputs, so this is a gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters (0 params), baseline is 4. Description adds no parameter info, but schema coverage is 100% trivially.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it gets current road incidents with examples (accidents, roadworks, heavy traffic), distinguishing from sibling tools for other transport modes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description implies usage for road incidents and mentions updates every 2 minutes, providing context. However, lacks explicit when-not or alternative tool references, though siblings are distinct.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.