agl-api-explorer

agl-api-explorer is an agent for Claude Code from NaanyaBiz/haggle. It costs 86 tokens per session (891 once invoked), scanned A, original, Apache-2.0.

Use when reverse-engineering or implementing anything in customcomponents/haggle/agl/ — the Auth0 token lifecycle (AglAuth), the REST API calls (AglClient), or the JSON response parsers. Also the go-to agent when debugging AGL HTTP behaviour, 401s, rate limits, or response shape questions. Owns all files under…

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/naanyabiz/haggle/agl-api-explorer
Clone the repo
git clone --depth 1 https://github.com/NaanyaBiz/haggle

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agl-api-explorer

README.md
[![agentmods](https://agentmods.dev/badge/agents/naanyabiz/haggle/agl-api-explorer.svg)](https://agentmods.dev/agents/naanyabiz/haggle/agl-api-explorer)
Your own site
<a href="https://agentmods.dev/agents/naanyabiz/haggle/agl-api-explorer"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/agl-api-explorer.svg" alt="Measured on agentmods" height="20"></a>
Per session 86 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 891 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00086 $0.00891
Opus 5 $0.00043 $0.00445
Sonnet 5 $0.00017 $0.00178
Haiku 4.5 $0.00009 $0.00089

Measured today against content hash 2f34e73e19f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agl-api-explorer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/agl-api-explorer.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in the AGL Energy Australia mobile app API.

Source of truth

The definitive reference is the AGENTS.md file in the repo root (§ AGL API — Key Facts). Anonymised response shapes are in tests/fixtures/*.json.

API constants

Auth host: https://secure.agl.com.au
Data host: https://api.platform.agl.com.au
Client ID: 2mDkNcC8gkDLL7FTT1ZxF5rrQHrLTHL3
Client-Flavor header: app.iOS.public.8.38.0-531   ← always send
User-Agent: AGL/531 CFNetwork/3860.500.112 Darwin/25.4.0

Auth0 token flow

  1. POST https://secure.agl.com.au/oauth/token with grant_type=refresh_token, client_id, refresh_token.
  2. Response: access_token (24h JWT, RS256), refresh_token (NEW — rotated), expires_in.
  3. CRITICAL: Persist the new refresh_token immediately via persist_callback. Failure = lockout on next cycle.
  4. Proactive refresh: when now > expires_at - 5 min, exchange before calling data APIs.
  5. On 401 from data API: force a refresh and retry exactly once. If second 401, raise AGLAuthError.

Data API endpoints (all under /mobile/bff)

GET /api/v3/overview
    → accounts[].contracts[].contractNumber, hasSolar, meterType

GET /api/v1/servicehub/energy/{contractNumber}
    → hyperlinks dict (usage, managePlan, usageInsight, ...)

GET /api/v2/usage/smart/Electricity/{contractNumber}/Current/Hourly?period=YYYY-MM-DD_YYYY-MM-DD
    → 30-min intervals. Use sections[].items[].consumption.values.quantity for kWh.
      DO NOT use consumption.quantity (rounded for UI).
      dateTime is slot-start in UTC. Filter type='none'.

GET /api/v2/usage/smart/Electricity/{contractNumber}/Current/Daily?period=...
GET /api/v2/usage/smart/Electricity/{contractNumber}/Previous/Hourly?period=...
GET /api/v2/usage/smart/Electricity/{contractNumber}/Previous/Daily?period=...
GET /api/v2/plan/energy/{contractNumber}
    → gstInclusiveRates[]: unit rate (c/kWh) and supply charge (c/day)

Key subtleties

  • "Hourly" means 30-minute granularity.
  • Request one day at a time for /Hourly (single-day period gives highest fidelity).
  • For backfill on first install: last 30 days, one day/request, ~1 req/s to avoid 429.
  • scaling= param in /Hourly and /Daily is UI-only; try omitting it.
  • Response bodies are gzip-encoded; aiohttp handles transparently.
  • Gas contracts use the same path shape with Gas replacing Electricity.

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 77 lines · 86 tokens per session scan A 2f34e73e19f9

Subscribe to this mod's changes

agl-api-explorer is an agent published in the GitHub repository NaanyaBiz/haggle (13 stars, last pushed yesterday), licensed Apache-2.0. It adds 86 tokens to every session and 891 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other agents, from other repositories

aemo-mcp-expert

Use when the user asks about Australian electricity market data — spot prices, generation, demand, interconnector flows, rooftop solar, predispatch forecasts. Translates plain-English questions into aemo-mcp tool calls. NEM only (NSW1/QLD1/SA1/TAS1/VIC1); Western Australia WEM is out of scope.

Bigred97/aemo-mcp · 79 tokens

impl

Scoped implementation work whose correctness a test or lint run can prove. Use for Go/Svelte changes inside named files with a stated acceptance command. NOT for composition-root wiring, wire formats, REST/WS contract semantics, Matter parity constants, or auth/secret code.

SukramJ/openccu-loom · 55 tokens

PHP MCP Expert

Expert assistant for PHP MCP server development using the official PHP SDK with attribute-based discovery.

github/awesome-copilot · 20 tokens

cpp-reviewer

Expert C++ code reviewer specializing in memory safety, modern C++ idioms, concurrency, and performance. Use for all C++ code changes. MUST BE USED for C++ projects.

affaan-m/ECC · 41 tokens

php-developer

Write idiomatic PHP code with design patterns, SOLID principles, and modern best practices. Implements PSR standards, dependency injection, and comprehensive testing. Use PROACTIVELY for PHP architecture, refactoring, or implementing design patterns.

davepoon/buildwithclaude · 51 tokens

Geoprocessing Specialist

ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.

SHAdd0WTAka/Zen-Ai-Pentest · 45 tokens