Skip to main content
Glama

train_alerts

Get real-time alerts for Singapore train service disruptions and shuttle services. Receive updates when changes occur to help plan your commute.

Instructions

Get real-time train service alerts including service disruptions and shuttle services. Updates when there are changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'train_alerts' tool. Fetches real-time train service alerts from the LTA DataMall API using axios and returns the JSON response or an error message.
    case "train_alerts": {
      try {
        const response = await axios.get('https://datamall2.mytransport.sg/ltaodataservice/TrainServiceAlerts', {
          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;
      }
    }
  • The input schema and description for the 'train_alerts' tool, registered in the ListTools response. No input parameters are required.
    {
      name: "train_alerts",
      description: "Get real-time train service alerts including service disruptions and shuttle services. Updates when there are changes.",
      inputSchema: {
        type: "object",
        properties: {} // No parameters needed
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'real-time' and 'Updates when there are changes,' which hints at dynamic data, but lacks details on rate limits, authentication needs, error handling, or response format. For a tool with zero annotation coverage, this is insufficient to fully inform agent behavior.

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

Conciseness4/5

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

The description is concise and front-loaded: two sentences that directly state the purpose and update behavior. There's no wasted text, and it efficiently communicates key information. It could be slightly improved by structuring usage guidance more explicitly, but it's well-sized for its content.

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?

Given the tool's complexity (simple read operation with 0 parameters), no annotations, and no output schema, the description is moderately complete. It covers the purpose and update behavior but lacks details on output format, error cases, or integration with siblings. It's adequate as a minimum viable description but has clear gaps in behavioral and contextual guidance.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate. Baseline is 4 for 0 parameters, as it doesn't need to compensate for gaps, but it doesn't reach 5 since it doesn't explicitly state the lack of parameters.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get real-time train service alerts including service disruptions and shuttle services.' It specifies the verb ('Get') and resource ('train service alerts'), and includes scope details ('real-time', 'service disruptions and shuttle services'). However, it doesn't explicitly differentiate from sibling tools like 'traffic_incidents' or 'travel_times', which prevents a score of 5.

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

Usage Guidelines2/5

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

The description provides minimal usage guidance: 'Updates when there are changes' implies it's for monitoring changes in alerts, but it doesn't specify when to use this tool versus alternatives (e.g., 'traffic_incidents' for road issues or 'bus_arrival' for bus info). No explicit when/when-not or alternative tool references are included, leaving gaps in context.

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

Install Server

Other Tools

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