Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TIMEZONENoIANA timezoneAsia/Shanghai
HTTP_HOSTNoHTTP binding address0.0.0.0
HTTP_PORTNoHTTP port8080
MCP_DEBUGNoEnable debug loggingfalse
AMAP_API_KEYNoAMAP (Gaode) API key for geocoding
TESLA_CAR_IDNoDefault car ID1
MCP_TRANSPORTNoTransport mode: stdio or streamable-httpstreamable-http
TESLA_GAS_MPGNoICE vehicle MPG28
TESLA_GAS_PRICENoGas price per gallon3.50
QWEATHER_API_KEYNoQWeather API key
TESLA_CAR_PARAMSNoJSON object mapping car_id to {kwh, range_km}
USE_METRIC_UNITSNoUse metric unitstrue
QWEATHER_API_HOSTNoQWeather API host (e.g. xxxx.re.qweatherapi.com)
TESLAMATE_DB_HOSTYesPostgreSQL host
TESLAMATE_DB_NAMEYesDatabase name
TESLAMATE_DB_PASSYesDatabase password
TESLAMATE_DB_PORTNoPostgreSQL port5432
TESLAMATE_DB_USERYesDatabase user
TESLA_BATTERY_KWHNoBattery capacity in kWh (single car fallback)78.4
TESLA_AMAP_TIMEOUTNoAMAP request timeout (seconds)8
TESLA_LIMIT_DRIVESNoMax drives returned500
TESLA_LIMIT_CHARGINGNoMax charging records500
TESLA_BATTERY_RANGE_KMNoFull range in km (single car fallback)675
TESLA_QWEATHER_TIMEOUTNoQWeather request timeout (seconds)8
TESLA_LIMIT_TPMS_HISTORYNoMax TPMS history records60
TESLA_TPMS_MAX_THRESHOLDNoHigh tire pressure threshold (bar)3.5
TESLA_TPMS_MIN_THRESHOLDNoLow tire pressure threshold (bar)2.5
TESLA_WEATHER_SAMPLE_MAXNoMax trips for weather efficiency analysis60
TESLA_LIMIT_STATE_HISTORYNoMax state transitions500
TESLA_LIMIT_VAMPIRE_DRAINNoMax vampire drain events50
TESLA_ELECTRICITY_RATE_RMBNoElectricity rate in RMB per kWh0.6
TESLA_ELECTRICITY_RATE_USDNoElectricity rate in USD per kWh (fallback)0.12
TESLA_LIMIT_BATTERY_HEALTHNoMax battery health snapshots60
TESLA_LIMIT_BATTERY_SAMPLESNoFallback battery samples30
TESLA_LIMIT_TRIP_CATEGORIESNoMax trips for categories analysis500
TESLA_LIMIT_LOCATION_HISTORYNoMax location clusters50
TESLA_LIMIT_SOFTWARE_UPDATESNoMax software updates30
TESLA_LIMIT_CHARGING_BY_LOCATIONNoMax charging locations50

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
tesla_versionA

Server version & diagnostic info — call first to confirm the build.

Returns the running server version, Python/fastmcp versions, timezone, tool count, and whether the TeslaMate database is reachable. Useful for support, debugging, and confirming you hit the expected deployment.

tesla_carsA

List all vehicles registered in TeslaMate.

Returns each car's ID, name, model, VIN, and efficiency. Use the car_id with other tools to query a specific vehicle.

tesla_statusB

Current vehicle state -- battery, range, location, climate, odometer.

Returns the latest position snapshot and vehicle info from TeslaMate.

tesla_charging_historyB

Charging sessions over the last N days.

Shows energy added, duration, battery range, and location for each session.

tesla_chargesB

Detailed charging sessions with location, energy, cost breakdown.

Unlike tesla_charging_history which summarizes by process, this returns granular charging session data.

tesla_drivesC

Recent drives -- distance, duration, efficiency, start/end locations.

Shows driving activity with energy consumption.

tesla_driving_scoreC

Driving score based on acceleration, braking, and speed habits.

tesla_trips_by_categoryC

Get trips filtered by category.

tesla_trip_categoriesC

Show count of trips by category for recent drives.

tesla_battery_healthB

Battery degradation trend -- range at 100% charge over time.

Shows monthly snapshots of ideal range when battery is at 100%.

tesla_efficiencyB

Energy consumption trends -- Wh/mi over time.

Shows weekly average efficiency from driving data.

tesla_location_historyB

Where the car has been -- top locations by time spent.

Groups positions by proximity and shows time at each cluster.

tesla_state_historyB

Vehicle state transitions -- online, asleep, offline.

Shows when the car was awake vs sleeping, useful for vampire drain analysis.

tesla_software_updatesB

Firmware version history -- all recorded software versions and install dates.

tesla_liveA

Latest polled vehicle state from TeslaMate -- battery, climate, location.

Data comes from TeslaMate's positions table (polled periodically, not real-time). Fields like sentry mode, lock status, and media are not available in TeslaMate and are omitted.

tesla_savingsC

Gas savings scorecard -- how much you've saved vs a gas car.

tesla_trip_costA

Estimate trip cost to a destination -- kWh, cost, range check.

Uses your personal 30-day average efficiency and current battery level. If QWeather is configured, the current weather at the origin and the destination is shown for reference only — it does NOT change the energy or cost estimate.

tesla_weatherA

Current weather at the car's location (via QWeather 和风天气).

Uses the vehicle's latest GPS position to fetch real-time weather — temperature, feels-like, humidity, wind, precipitation, visibility, conditions. Complements TeslaMate's single outside_temp sensor.

Requires QWEATHER_API_KEY + QWEATHER_API_HOST env vars; otherwise returns a friendly hint and changes nothing else.

tesla_efficiency_by_tempC

Efficiency curve by temperature -- Wh/mi at different temps.

Shows how outside temperature affects energy consumption.

tesla_efficiency_by_weatherA

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.

tesla_charging_by_locationC

Charging sessions grouped by location.

tesla_top_destinationsB

Most visited locations ranked by number of visits.

tesla_longest_tripsC

Top drives ranked by distance -- your epic road trips.

tesla_monthly_reportC

Monthly driving report with stats and comparison to previous month.

tesla_tpms_statusA

Current TPMS pressures with warnings for anomalies.

Reads from the latest position record in TeslaMate. Warns if any tyre is below TESLA_TPMS_MIN_THRESHOLD or above TESLA_TPMS_MAX_THRESHOLD, or differs from the average by > 0.15 bar.

tesla_tpms_historyA

Recent TPMS pressure history from TeslaMate.

Shows the average and min/max pressures recorded in positions table. Note: TeslaMate only stores positions during drives/charging, not while parked.

tesla_monthly_summaryA

Monthly driving summary -- splits energy into three independent categories:

  • Drive kWh -- estimated from drive range-drop (行驶能耗)

  • Charge kWh -- energy added during charging sessions (充电能耗)

  • Vampire kWh -- parked drain between drive_end and next event (停车耗电)

Wh/km uses ONLY driving kWh so efficiency is not contaminated by charging losses or vampire drain. The three categories are summed independently from their respective primary sources and never mixed in calculations.

tesla_vampire_drainA

Vampire drain analysis -- battery loss while parked overnight.

Checks for periods where the car was parked (no drives) for 8+ hours and measures battery drop. A parked period is tagged "露营模式" when the AVERAGE drain rate over the parked period is ≥ TESLA_CAMPING_KWH_PER_HOUR (default 0.8 kWh/h). The kWh conversion uses a fixed 75 kWh reference battery — so the threshold does NOT change whether the car is 75 / 82 / 100 kWh. Sentry and third-party-app activity are NOT distinguished from camping use: any aggregate drain rate at or above the threshold is flagged. If QWeather is configured, the current weather at the parking location is shown for the worst few events AND every camping-mode event (display-only).

calculate_eco_savings_vs_icevB

Calculate eco savings and carbon reduction compared to an ICEV (燃油汽车).

Compares Tesla's actual electricity costs against a hypothetical ICEV consuming the same distance in fuel, plus CO2 savings and tree equivalents.

generate_travel_narrative_contextC

Generate a travel narrative timeline for LLM-powered travel blogging.

Extracts structured drive and stop data within a time window for generating travel narratives or Vlog scripts.

get_vehicle_persona_statusA

Get vehicle persona status -- activity, fatigue, extremes, and health metrics.

Provides structured metrics for an LLM to roleplay a "vehicle with personality", including idle ratio, longest continuous drive, max speed, and vampire drain.

check_driving_achievementsC

Scan recent drives and charging sessions to check for driving achievements.

get_charging_vintage_dataC

Get detailed physical parameters for a single charging session.

Intended for LLM to roleplay a 'vintage data sommelier'.

generate_weekend_blindboxA

Discover rare one-time destinations as a weekend 'memory blindbox'.

Finds places visited only once in the lookback period, where the car stayed for at least min_stay_hours -- good candidates for a surprise 'where was I?' weekend trip recommendation.

generate_monthly_driving_reportC

Generate a polished Markdown monthly driving report with Emoji.

get_driver_profileB

Get driver gamification profile -- rank, milestones, and Easter eggs.

Returns the user's current driving rank, total stats, unlocked milestones, and hints for the next milestone. Easter egg triggers at 160,000 km.

Returns JSON with: current_rank, total_distance_km, total_charges, milestones_unlocked (list), next_milestone_hint, and special_160k Easter egg.

check_daily_questB

Check today's daily driving quest and progress.

Uses a deterministic hash of the current Beijing date to select one quest from the pool each day. Returns status: 未开始/进行中/已完成.

get_longest_trip_on_single_chargeB

Find the longest distance driven between two consecutive charges.

Uses window functions on charging_processes to define charge windows, then sums drives within each window to find the record.

Returns JSON with: record_distance_km, start_time, end_time, start_battery_pct, arrival_battery_pct, battery_consumed_pct, efficiency_comment.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

C2.9/5.0

Scored across 38 tools

Disambiguation2/5

Several tool pairs overlap heavily: tesla_status vs tesla_live both report current vehicle state; tesla_charging_history vs tesla_charges both return charging sessions; tesla_monthly_report, tesla_monthly_summary, and generate_monthly_driving_report all produce monthly summaries; tesla_savings vs calculate_eco_savings_vs_icev both compare against a gas car. Descriptions attempt to distinguish them, but the agent can easily pick the wrong one.

Naming Consistency3/5

Most tools share a tesla_ prefix without a verb, while a sizable minority use get_/generate_/check_/calculate_ verb patterns. The mix is still readable, but it is not a single predictable convention.

Tool Count2/5

With 38 tools, the surface is heavy for a read-only TeslaMate server, and many overlapping analytics could be parameters or consolidated. It far exceeds a well-scoped set and increases selection burden.

Completeness4/5

Coverage is broad: vehicle status, charging, drives, efficiency, battery health, TPMS, location, state history, software updates, savings, weather, and reports. Minor gaps exist around geofence/place management and deeper session drill-down, but typical analytics workflows are covered.

Maintenance

ActivitySlowing
ResponsivenessNo issues