Skip to main content
Glama

get_regional_conditions

Retrieve road conditions and events for British Columbia regions to plan trips. Filter by event types like construction, incidents, or weather conditions.

Instructions

Get road conditions and events for a specific BC region. Useful for planning trips within a geographic area.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionYesBC region name. Options: Lower Mainland, Vancouver Island, Thompson Okanagan, Kootenay Rockies, Cariboo, Northern BC
eventTypeNoFilter by event type (optional)
limitNoMaximum number of events to return (default: 50, max: 500)

Implementation Reference

  • The handler function executing the tool logic: validates region, fetches active events from DriveBC API filtered by region and optional type/limit, formats and returns the list or error messages.
    export async function handleRegionalConditions(args: {
      region: string;
      eventType?: EventType;
      limit?: number;
    }): Promise<string> {
      try {
        const regionId = findRegionId(args.region);
    
        if (!regionId) {
          const validRegions = Object.keys(BC_REGIONS).join(', ');
          return `Invalid region "${args.region}". Valid regions are: ${validRegions}`;
        }
    
        const params: EventQueryParams = {
          status: 'ACTIVE',
          area_id: regionId,
          limit: args.limit ?? 50,
        };
    
        if (args.eventType) {
          params.event_type = args.eventType;
        }
    
        const events = await getEvents(params);
    
        if (events.length === 0) {
          return `No current events found for ${args.region} region.`;
        }
    
        return `Regional Conditions for ${args.region}\n\n${formatEventList(events)}`;
      } catch (error) {
        if (error instanceof Error) {
          return `Error fetching regional conditions: ${error.message}`;
        }
        return 'Error fetching regional conditions: Unknown error';
      }
    }
  • Tool definition with name, description, and input schema for parameters: region (required), eventType (optional enum), limit (optional 1-500).
    export const regionalConditionsTool = {
      name: 'get_regional_conditions',
      description: 'Get road conditions and events for a specific BC region. Useful for planning trips within a geographic area.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          region: {
            type: 'string',
            description: `BC region name. Options: ${Object.keys(BC_REGIONS).join(', ')}`,
          },
          eventType: {
            type: 'string',
            enum: ['CONSTRUCTION', 'INCIDENT', 'WEATHER_CONDITION', 'ROAD_CONDITION', 'SPECIAL_EVENT'],
            description: 'Filter by event type (optional)',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of events to return (default: 50, max: 500)',
            minimum: 1,
            maximum: 500,
          },
        },
        required: ['region'],
      },
    };
  • src/index.ts:39-48 (registration)
    Registers the get_regional_conditions tool (via regionalConditionsTool) in the MCP server's list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          highwayConditionsTool,
          regionalConditionsTool,
          roadClosuresTool,
          weatherAlertsTool,
        ],
      };
    });
  • src/index.ts:56-75 (registration)
    Dispatches calls to the get_regional_conditions tool by invoking handleRegionalConditions in the MCP CallToolRequestHandler switch statement.
    switch (name) {
      case 'get_highway_conditions':
        result = await handleHighwayConditions(args as any);
        break;
    
      case 'get_regional_conditions':
        result = await handleRegionalConditions(args as any);
        break;
    
      case 'get_road_closures':
        result = await handleRoadClosures(args as any);
        break;
    
      case 'get_weather_alerts':
        result = await handleWeatherAlerts(args as any);
        break;
    
      default:
        throw new Error(`Unknown tool: ${name}`);
    }
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 states the tool retrieves data ('Get'), implying a read-only operation, but doesn't mention any behavioral traits like rate limits, authentication requirements, data freshness, or error handling. For a tool with no annotations, this leaves significant gaps in understanding how it behaves beyond basic functionality.

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, with two sentences that directly address purpose and usage. The first sentence clearly states what the tool does, and the second adds contextual value without redundancy. There's no wasted text, making it efficient for an agent to parse.

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 (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and a hint of usage, but lacks details on behavioral aspects, output format, or differentiation from siblings. Without annotations or an output schema, the description should do more to compensate, but it only meets the minimum viable threshold.

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 clear documentation for all parameters (region, eventType, limit). The description doesn't add any parameter-specific details beyond what's in the schema, such as explaining the relationship between parameters or providing examples. With high schema coverage, the baseline score of 3 is appropriate, as the schema already provides adequate parameter semantics.

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 road conditions and events for a specific BC region.' It specifies the verb ('Get') and resource ('road conditions and events'), and mentions the geographic scope ('BC region'). However, it doesn't explicitly differentiate from sibling tools like get_highway_conditions or get_road_closures, which likely have overlapping functionality.

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 provides some usage context: 'Useful for planning trips within a geographic area.' This implies when to use it, but doesn't explicitly state when to choose this tool over alternatives like get_highway_conditions or get_road_closures. No exclusions or prerequisites are mentioned, leaving the agent to infer usage based on the tool name and description alone.

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