Skip to main content
Glama

get_highway_conditions

Retrieve current conditions, incidents, and closures for British Columbia highways to plan safe travel routes and avoid disruptions.

Instructions

Get current conditions, incidents, and closures for a specific BC highway. Returns active events including construction, accidents, weather conditions, and road closures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
highwayYesHighway number or name (e.g., "Highway 1", "Highway 99", "1", "99")
severityNoFilter by severity level (optional)
includeScheduledNoInclude scheduled construction/maintenance (default: true)

Implementation Reference

  • The handleHighwayConditions function that executes the tool logic: normalizes highway name, fetches events via API, filters by severity and scheduled events, formats the output.
    export async function handleHighwayConditions(args: {
      highway: string;
      severity?: 'MINOR' | 'MODERATE' | 'MAJOR' | 'UNKNOWN';
      includeScheduled?: boolean;
    }): Promise<string> {
      try {
        const normalizedHighway = normalizeHighwayName(args.highway);
        const includeScheduled = args.includeScheduled ?? true;
    
        const params: EventQueryParams = {
          status: 'ACTIVE',
          road_name: normalizedHighway,
        };
    
        if (args.severity) {
          params.severity = args.severity;
        }
    
        const events = await getEvents(params);
    
        let filteredEvents = events;
        if (!includeScheduled) {
          filteredEvents = events.filter(e => e.event_type !== 'CONSTRUCTION');
        }
    
        if (filteredEvents.length === 0) {
          return `No current events found for ${normalizedHighway}.`;
        }
    
        return `Highway Conditions for ${normalizedHighway}\n\n${formatEventList(filteredEvents)}`;
      } catch (error) {
        if (error instanceof Error) {
          return `Error fetching highway conditions: ${error.message}`;
        }
        return 'Error fetching highway conditions: Unknown error';
      }
    }
  • Tool definition including name, description, and input schema for validation.
    export const highwayConditionsTool = {
      name: 'get_highway_conditions',
      description: 'Get current conditions, incidents, and closures for a specific BC highway. Returns active events including construction, accidents, weather conditions, and road closures.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          highway: {
            type: 'string',
            description: 'Highway number or name (e.g., "Highway 1", "Highway 99", "1", "99")',
          },
          severity: {
            type: 'string',
            enum: ['MINOR', 'MODERATE', 'MAJOR', 'UNKNOWN'],
            description: 'Filter by severity level (optional)',
          },
          includeScheduled: {
            type: 'boolean',
            description: 'Include scheduled construction/maintenance (default: true)',
          },
        },
        required: ['highway'],
      },
    };
  • src/index.ts:39-48 (registration)
    Registers the highwayConditionsTool in the MCP server's list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          highwayConditionsTool,
          regionalConditionsTool,
          roadClosuresTool,
          weatherAlertsTool,
        ],
      };
    });
  • src/index.ts:57-59 (registration)
    Dispatches tool calls named 'get_highway_conditions' to the handler function in the MCP server's call tool request handler.
    case 'get_highway_conditions':
      result = await handleHighwayConditions(args as any);
      break;
Behavior3/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. It discloses behavioral traits: it returns 'current conditions, incidents, and closures' and 'active events including construction, accidents, weather conditions, and road closures,' indicating real-time data scope. However, it lacks details on permissions, rate limits, data freshness, or error handling, which are important for a read operation.

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 appropriately sized and front-loaded: the first sentence states the core purpose, and the second adds detail on return values. Both sentences earn their place by providing essential information without redundancy or fluff.

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 no annotations, no output schema, and 3 parameters with full schema coverage, the description is moderately complete. It covers the tool's purpose and return types but lacks output format details, error handling, or behavioral constraints, leaving gaps for a tool that fetches dynamic data.

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?

Schema description coverage is 100%, so the schema fully documents parameters. The description adds no additional parameter semantics beyond implying filtering by highway and event types, which is already covered in the schema. Baseline is 3 as the schema does the heavy lifting.

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 current conditions, incidents, and closures for a specific BC highway' with specific resources (highway conditions) and verb (get). It distinguishes from siblings by specifying 'specific BC highway' (vs. regional, road closures only, or weather alerts only), though it doesn't explicitly name alternatives.

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 specifying 'specific BC highway' and listing event types, suggesting it's for detailed highway-level info. However, it doesn't explicitly state when to use this tool vs. siblings like get_regional_conditions or get_road_closures, nor does it provide 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/infil00p/DriveBC_MCP'

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