Skip to main content
Glama

Plan the cheapest charge

plan_cheapest_charge
Read-only

Find the cheapest hours to charge your Polestar within its scheduled charge window using hourly electricity prices, ensuring enough energy to reach the target charge level.

Instructions

Given hourly electricity prices, computes the cheapest hours inside the car's charge window (from global-charge-timer) that deliver enough energy to reach the target charge level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vinNoVehicle Identification Number. Optional when the credential has exactly one vehicle, omit it and the only vehicle is used.
phasesNoAC phases at your charger (default 3, Swedish 400V three-phase).
pricesYesHourly prices from your spot-price provider: [{startsAt: "2026-09-19T22:00:00+02:00", price: 0.42}, ...]
capacityKwhNoUsable pack capacity; auto-derived from dischargeInfo.energyAvailable when the car reports it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesFalse when the call produced no data.
vinNoVehicle the result is about, masked when POLESTAR_REDACT_VIN is on.
codeNoMachine-readable error code when ok is false.
dataNoStructured payload; shape documented per tool.
hintNoActionable guidance when ok is false.
toolNoTool that produced this result.
messageYesResult text, identical to the content block.
requestIdNoUpstream request id, the handle support needs.
ageSecondsNoStaleness of the underlying telemetry.
httpStatusNoUpstream HTTP status when ok is false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already mark this read-only, and the description reinforces that by saying it 'computes' a plan rather than executing a charge. It adds non-obvious context about depending on the global-charge-timer window and ensuring enough energy to hit the target level. It does not disclose failure behavior when the window cannot satisfy the target, but the output schema and open-world hint mitigate that gap.

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?

One sentence with no filler. It front-loads the input ('Given hourly electricity prices'), states the core computation, and names both dependencies. Every word contributes.

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?

The description, combined with the fully covered input schema, the output schema, and the readOnly/openWorld annotations, gives an agent everything needed to invoke the tool correctly. It explains the tool's inputs, dependencies, and output intent without over-explaining return values.

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 all four parameters are already documented. The description adds conceptual context by linking prices, the charge window, and the target level, but it does not add parameter-level detail 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?

The description uses a specific verb ('computes') with a clear resource ('cheapest hours inside the car's charge window') and a measurable goal ('deliver enough energy to reach the target charge level'). It is immediately distinct from the sibling getter tools, which retrieve state rather than produce a plan.

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?

The description clearly states the input condition ('Given hourly electricity prices') and the constraints it uses ('charge window', 'target charge level'), so an agent knows when this tool is relevant. It does not explicitly name alternative tools or exclusion cases, but the context is strong enough to route appropriate requests.

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