Skip to main content
Glama

station_crowding

Check real-time crowdedness levels for Singapore MRT/LRT stations by train line to plan travel and avoid peak times.

Instructions

Get real-time MRT/LRT station crowdedness level for a particular train network line. Updates every 10 minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trainLineYesCode of train network line (CCL, CEL, CGL, DTL, EWL, NEL, NSL, BPL, SLRT, PLRT, TEL)

Implementation Reference

  • Handler function for the 'station_crowding' tool that fetches real-time MRT/LRT station crowdedness levels from the LTA DataMall API for a specified train line and returns the JSON response.
    case "station_crowding": {
      const { trainLine } = request.params.arguments as {
        trainLine: string;
      };
    
      try {
        const response = await axios.get('https://datamall2.mytransport.sg/ltaodataservice/PCDRealTime', {
          params: {
            TrainLine: trainLine
          },
          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:67-81 (registration)
    Registration of the 'station_crowding' tool in the listTools handler, including name, description, and input schema.
    {
      name: "station_crowding",
      description: "Get real-time MRT/LRT station crowdedness level for a particular train network line. Updates every 10 minutes.",
      inputSchema: {
        type: "object",
        properties: {
          trainLine: {
            type: "string",
            description: "Code of train network line (CCL, CEL, CGL, DTL, EWL, NEL, NSL, BPL, SLRT, PLRT, TEL)",
            enum: ["CCL", "CEL", "CGL", "DTL", "EWL", "NEL", "NSL", "BPL", "SLRT", "PLRT", "TEL"]
          }
        },
        required: ["trainLine"]
      }
    },
  • Input schema definition for the 'station_crowding' tool, specifying the required 'trainLine' parameter with allowed enum values.
    inputSchema: {
      type: "object",
      properties: {
        trainLine: {
          type: "string",
          description: "Code of train network line (CCL, CEL, CGL, DTL, EWL, NEL, NSL, BPL, SLRT, PLRT, TEL)",
          enum: ["CCL", "CEL", "CGL", "DTL", "EWL", "NEL", "NSL", "BPL", "SLRT", "PLRT", "TEL"]
        }
      },
      required: ["trainLine"]
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context: the data is 'real-time' and 'Updates every 10 minutes,' which informs about freshness and update frequency. However, it lacks details on potential errors, rate limits, authentication needs, or what the output looks like (e.g., format or structure), leaving gaps in behavioral understanding.

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?

The description is concise and well-structured in two sentences: the first states the purpose, and the second adds behavioral context (update frequency). Every sentence earns its place by providing essential information without redundancy, making it front-loaded and efficient.

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 moderate complexity (single parameter, no annotations, no output schema), the description is partially complete. It covers the purpose and update behavior but lacks details on output format, error handling, or how it differs from siblings. Without an output schema, the description should ideally explain return values, which it does not, resulting in a score of 3 as adequate but with clear gaps.

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

Parameters3/5

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

The input schema has 100% description coverage, with a clear enum for 'trainLine' parameter. The description does not add any semantic details beyond what the schema provides (e.g., it doesn't explain the meaning of line codes or provide examples). According to the rules, with high schema coverage, the baseline is 3 even without additional param info in the description.

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 MRT/LRT station crowdedness level for a particular train network line.' It specifies the verb ('Get'), resource ('station crowdedness level'), and scope ('particular train network line'), but does not explicitly differentiate it from sibling tools like 'station_crowd_forecast' 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 Guidelines3/5

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

The description implies usage context by mentioning 'real-time' and 'Updates every 10 minutes,' which suggests when to use it for current data. However, it does not provide explicit guidance on when to use this tool versus alternatives like 'station_crowd_forecast' (which might offer predictions) or other siblings, nor does it state any exclusions or prerequisites.

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