Skip to main content
Glama

Tesla Efficiency By Weather

tesla_efficiency_by_weather

Analyze Tesla driving efficiency grouped by actual historical weather conditions like clear, rain, snow, fog, and wind. Reveals how weather, not just temperature, affects energy consumption.

Instructions

Efficiency grouped by weather condition (via QWeather historical data).

Unlike tesla_efficiency_by_temp (which only buckets by outside_temp), this back-fills each drive's actual weather (clear/rain/snow/fog/wind) from QWeather's historical API and shows how conditions — not just temperature — affect consumption. Same 5°C day can differ hugely: dry-clear vs rain/snow.

Method (no database writes):

  1. Pull recent drives with start/end coords, time, and ideal-range delta.

  2. For each drive use its midpoint coordinate + mid-time to resolve a QWeather LocationID (cached) then daily historical weather (cached).

  3. Bucket the drive by weather and aggregate kWh / distance per bucket.

To stay within API limits only the most recent drives are sampled (TESLA_WEATHER_SAMPLE_MAX, default 60). Requires QWEATHER_API_KEY + QWEATHER_API_HOST; otherwise returns a friendly hint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoLook-back window in days (default: 90)
car_idNoFilter by vehicle ID (default: TESLA_CAR_ID env or first car)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden, and it does so well: it discloses the no-database-writes behavior, the API rate-limit mitigation via sampling (TESLA_WEATHER_SAMPLE_MAX default 60), caching, and required env vars with a graceful fallback. It stops short of describing output shape, but an output schema exists to cover returns.

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?

Front-loaded purpose statement followed by a clear contrast, then a numbered method and a limits note. The method list is slightly long but each step earns its place by explaining the sampling/caching pipeline. No redundant filler.

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

Completeness5/5

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

For a multi-step analysis tool with external API dependencies, the description covers the method, constraints (sampling, caching, API keys), and result grouping. An output schema exists so return values need not be explained. Nothing critical to correct invocation is missing.

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 two parameters (days, car_id) are already documented in the schema with defaults and env fallbacks. The description adds contextual detail about sampling and env-based car selection but nothing parameter-specific beyond what the schema provides. Baseline 3 is appropriate.

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?

States a specific analysis (efficiency grouped by weather condition) and explicitly contrasts with the sibling tesla_efficiency_by_temp, noting it buckets by actual weather rather than just outside_temp. An agent can distinguish this tool from its closest sibling without opening either schema.

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?

Points to the alternative (tesla_efficiency_by_temp) and explains the differentiating condition (weather condition vs temperature bucket). It also surfaces prerequisites (QWEATHER_API_KEY/HOST). However, it does not state explicit when-not-to-use conditions or when the temp-based tool is preferable.

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