---
title: "Claude Fable 5.2 on Pydantic AI Geo Analyst"
description: "Spatial questions and SVG maps from raw earthquake, fire and place data in DuckDB. Tool calling 100%, code mode 100%; rank 1 of 20."
canonical: https://models.pydantic.dev/models/claude-fable-5.2/geo_analyst/
---

# Claude Fable 5.2 on Pydantic AI Geo Analyst

> Spatial questions and SVG maps from raw earthquake, fire and place data in DuckDB. Tool calling 100%, code mode 100%; rank 1 of 20.
>
> Markdown copy of https://models.pydantic.dev/models/claude-fable-5.2/geo_analyst/. Index for agents: https://models.pydantic.dev/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://models.pydantic.dev/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://models.pydantic.dev/select.md
- Search models by name: `GET https://models.pydantic.dev/api/search?query=<text>`
- List, filter and sort models: `GET https://models.pydantic.dev/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://models.pydantic.dev/api/models/<slug>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of the first three. An `OPTIONS` request to any endpoint returns its schema. The same four are tools of the MCP server at `https://models.pydantic.dev/mcp`. More: https://models.pydantic.dev/usage.md

About the benchmark: https://models.pydantic.dev/benchmarks/geo_analyst.md. The model on every Pydantic AI benchmark: https://models.pydantic.dev/models/claude-fable-5.2.md

| Mode         | Score | Tasks passed | Cost  | Requests | Tool calls | Time    |
| ------------ | ----- | ------------ | ----- | -------- | ---------- | ------- |
| Tool calling | 100%  | 10 of 10     | $2.73 | 68       | 100        | 7.3 min |

Each task was run once per mode.

## Review

Written by an LLM from the runs' transcripts.

#### Overall

The model passed all 20 runs: 10 cases, each in both modes. Across the 10 cases, tool calling used 68 requests and cost $2.73, while code mode used 52 requests and cost $2.09. No run failed, and the reviewers recorded no root-cause issues. The weaknesses below are about how robust the method was, not whether the answer was right.

#### Where it does well

- **Reads the data dictionary first and decodes it.** In every run it read DATA.md before querying. It then applied the encodings it found: magnitude ×100 or in tenths, depth as negative metres, catalogue B's year-day and N/S/E/W format, and mixed-offset timestamps converted to UTC.
- **Tells similar names apart.** It chose Anchorage, Alaska over Anchorage, Kentucky (b_gof) and Mato Grosso (BRA-602) over Mato Grosso do Sul (deep_moment's sibling case mato_grosso).
- **Uses the correct geometry.** It used 3D hypocentral distance where the question said "hypocentre" (b_only_hypo, exposed, pair_map_hypo) and handled the antimeridian in pair_map_hypo. It also applied ST_MakeValid to the invalid Goiás polygon in brazil_nn.
- **Checks thresholds.** It used widened bands around the limits in deep_moment, exposed, b_only_hypo and cross_section. In world_clusters it confirmed convergence by checking that zero edges crossed labels.

#### Mistakes it makes

- **Hardcoded values.** It set the overlap window by hand to rounded minutes (16:00 to 15:36) in both b_only_hypo runs and both pair_map_hypo runs, instead of deriving it from the data.
- **Assumptions that held by luck.** Several assumptions were never verified:
  - In world_clusters, a 0.03° longitude bin is narrower than 1 km above about 72° latitude. The data happened not to go that far north.
  - The tools-mode run of world_clusters did not wrap longitude bins at the antimeridian.
  - The bounding-box prefilters in brazil_nn (code mode) and the latitude prefilter in exposed (code mode) were never justified.
- **Filters without stated reasons.** It often applied k='T' and the S/H/Q place exclusions without explaining why. It also never checked the `rv` revisions field (b_gof and deep_moment in code mode).
- **Manual steps.** In tools mode it pasted SVG content into write_file by hand (pair_map_hypo) and picked ids by eye from a tolerance band (exposed).
- **Wasted calls.** Examples include:
  - a bad column reference (b_only_hypo)
  - a multi-statement SQL call that lost one result (exposed)
  - about 25 label-propagation batches repeated by hand (world_clusters, tools)
  - a redundant rerun (local_night, code mode)

#### Tool calling compared with code mode

Both modes were equally accurate. Code mode was cheaper in 6 of 10 cases, and the savings were largest on heavy, iterative work:

| Case           | Tools              | Code mode         |
| -------------- | ------------------ | ----------------- |
| pair_map_hypo  | $0.78, 10 requests | $0.31, 6 requests |
| world_clusters | $0.52, 13 requests | $0.34, 8 requests |
| cross_section  | $0.31              | $0.17             |

Code mode let the model loop until convergence, verify written files programmatically, and print every candidate. For example, in b_gof it showed Mc=2.0 with R=89.52, whereas the tools run left the chosen row truncated.

Tool calling was cheaper on 4 cases: brazil_nn, deep_moment, exposed and local_night. The biggest gap was local_night, at $0.17 with tools versus $0.31 in code mode.

For simple lookups the two modes are close. For multi-step or iterative pipelines, code mode is the better choice.

## Runs

### deep_moment

**Tool calling: passed.** The agent read DATA.md, loaded catalogue A into DuckDB, converted the local-offset times to UTC and counted events with magnitude type '3' (moment magnitude), m≥500 (hundredths), z\<-70000 (metres) and k='T' between 1 and 16 Nov UTC. It returned 7, which matches the expected answer. ($0.10, 4 requests, 11 s)
- Right: Read DATA.md before querying and loaded the JSON with explicit column types, keeping `m` and `mk` as strings so the codes stayed intact.
- Right: Converted the `t` strings, which carry mixed UTC offsets such as -11:00 and +09:00, to UTC before filtering by date.
- Right: Applied the units from the data dictionary: magnitude stored ×100 (`mi>=500`) and depth in negative metres (`z < -70000`).
- Right: Checked boundary cases with a deliberately wider exploratory query (M≥4.8, depth >60 km, extra 12 hours at each end), which showed which events fell just outside the date and magnitude limits.
- Right: Confirmed ids are unique (9566 rows, 9566 distinct ids), so duplicate revisions could not inflate the count.
- Right: Filtered on event kind `k='T'`.

### mato_grosso

**Tool calling: passed.** The agent read DATA.md, found Mato Grosso (BRA-602) in regions.tsv and checked the fire schema and class codes. It counted cls='H' fires on 21 Nov 2026 (UTC epoch range) inside the state polygon and got 5, which matches the expected answer. ($0.096, 4 requests, 13 s)
- Right: Read DATA.md first, as the handbook instructs.
- Right: Told Mato Grosso (BRA-602) apart from Mato Grosso do Sul (BRA-600) instead of relying on the loose ilike match.
- Right: Checked the cls values (H/N/L) and the BIGINT epoch type of t before filtering.
- Right: Used a point-in-polygon test (ST_Intersects) with a bounding-box prefilter, and checked that the 5 hits had no duplicate fid or (lat,lon,t,sat) rows.
- Mistake: The day window was taken in UTC (epoch of '2026-11-21 00:00:00') without stating it in the transcript. Since DATA.md was truncated in the shown output, it is unclear whether the agent checked whether the conventions call for local time; the result matched anyway.
- Mistake: The final duplicate-check query over the whole parquet file was not needed once the per-day result already showed 5 distinct fids.

### b_only_hypo

**Tool calling: passed.** The agent loaded both catalogues, restricted B events with magnitude 4.5 or more to the overlap window (from A's first event on 26 Oct to its last on 25 Nov), and anti-matched them against A within 30 s and 50 km of 3D hypocentral distance. It answered 36, which is correct. ($0.21, 8 requests, 35 s)
- Right: Read DATA.md first and checked the raw formats of both files before parsing.
- Right: Parsed B's year-day date plus seconds-of-day into an epoch, and handled the N/S/E/W hemisphere suffixes correctly.
- Right: Converted A's z (negative metres) into a depth in km, and parsed A's local-offset timestamps into timestamptz.
- Right: Limited B to the period both catalogues cover, using A's min/max timestamps, and did not count all 674 magnitude ≥4.5 events.
- Right: Used a 3D Earth-centred cartesian distance that includes depth, which matches the 'hypocentre within 50 km' wording.
- Right: Ran sensitivity checks near the 30 s and 50 km thresholds; nearthr=26 and neart=1 showed borderline pairs and confirmed none flips the count.
- Mistake: The first run_sql failed because it referenced column z after renaming it to dep. This was a minor wasted call.
- Mistake: The overlap bounds were hard-coded with rounded literals ('2026-10-26 16:00:00' to '2026-11-25 15:36:00') rather than taken from the actual min/max of A. It worked, but it is fragile.
- Mistake: The final message gave only the bare JSON with no explanation of the method or the overlap window.

### local_night

**Tool calling: passed.** The agent loaded catalogue A and the places file. It kept tectonic events (k='T') with m>=250 (hundredths of a magnitude), found the nearest settlement by haversine while excluding place kinds S, H and Q, converted each time to that settlement's tz and counted local hours >=20 or \<6. The answer was 787, which matches the expected value. ($0.17, 6 requests, 37 s)
- Right: Read DATA.md first and inspected raw lines, which showed that m is stored in hundredths and z in metres.
- Right: Profiled event kinds and magnitude counts before filtering, and confirmed that every tz name in places is valid in DuckDB.
- Right: Took the nearest place by haversine distance with arg_min over a full cross join, then did a proper tz conversion with timezone(tz, ts). It checked the output type and spot-checked the local times.
- Right: The night window was coded correctly as hour>=20 or hour\<6.
- Mistake: The filters (k='T' only; excluding place kinds S, H, Q) rest on DATA.md conventions that the transcript truncates, so they cannot be checked here. The result matched, so they appear correct.
- Mistake: Minor: the cross join of 1804 quakes against about 160k places is brute force, but it worked.

### brazil_nn

**Tool calling: passed.** The agent loaded the Brazilian regions, selected the VIIRS fires (VJ1/VJ2) inside them, and computed the haversine distance from each fire to the nearest place with population of at least 10,000 (excluding place kinds S, H and Q). It returned counts and medians for all 27 divisions, and they match the expected answer. ($0.26, 8 requests, 48 s)
- Right: Read DATA.md first and checked the place kinds, populations and coordinate validity before building anything.
- Right: Kept only the VIIRS satellites VJ1 and VJ2 and left out the MODIS ones (MT, MA).
- Right: Applied ST_MakeValid to the invalid Goiás geometry, then checked that the raw-geometry count for BRA-1294 also came to 62.
- Right: Tested its 4-degree bounding-box prefilter: it reran a full cross join for the 353 fires whose nearest settlement was over 300 km away and got zero differences.
- Right: Used DuckDB's median, which averages the two middle values for an even count, as the question asks.
- Mistake: The settlement filter excluded kinds S, H and Q and limited candidates to a Latin American bounding box, without stating the rule from DATA.md that justifies this. The result matched, but the reasoning is not visible in the transcript.
- Mistake: The first DATA.md excerpt was truncated, and the follow-up substring query mostly returned blank segments. Some documented conventions may not have been read in full.

### exposed

**Tool calling: passed.** The agent read DATA.md, loaded catalogue A and places, and filtered to type 'T' events with non-null magnitude and to settlements of 500k or more (excluding kinds S/H/Q). It computed straight-line 3D hypocentral distances using depth, compared them with 10^(0.5M-0.7), and returned 23 place ids that match the expected answer. ($0.15, 4 requests, 20 s)
- Right: Read DATA.md before querying and applied its conventions: m/100 for magnitude, z in metres with negative meaning depth, k='T' for earthquakes, and excluding non-settlement place kinds.
- Right: Used true 3D hypocentral distance (chord through the Earth, using depth) rather than epicentral distance.
- Right: Used a 1.05 slack factor to inspect borderline cases, and from that output correctly dropped near-misses such as Shihezi (44.89 vs 44.67 km).
- Mistake: The first combined SQL call returned only the second statement's result, so the agent had to re-run the main query; one wasted call.
- Mistake: Some ids were picked from inside the 1.05 tolerance band by reading the output rather than through an exact filter. This worked here but was a manual step that could introduce errors, and part of the result was truncated in the transcript.

### b_gof

**Tool calling: passed.** The agent loaded places and catalogue A, found Anchorage AK (pid 5879400) and kept 1613 local-magnitude (mk=1) events within 300 km by haversine. It rounded magnitudes stored in tenths of units, ran the goodness-of-fit Mc search in a single SQL query and answered b=1.152, which matches the expected answer. ($0.14, 5 requests, 19 s)
- Right: Read DATA.md first and checked column types and the code distributions (k, mk) before filtering.
- Right: Picked the Anchorage, Alaska record (61.21806, -149.90028), not the Kentucky place with the same name.
- Right: Treated m as integer tenths and rounded halves up with floor((m+5)/10), which handles negative values correctly.
- Right: Did the whole Mc search in one query with a generate_series grid and a left join, so magnitudes with no observed events count as 0.
- Right: Restricted to k='T' (presumably earthquakes) and mk=1 (local magnitude), per the dictionary.
- Mistake: The selected Mc row falls in the truncated part of the result, so the transcript does not show which Mc gave R>=85. The answer is correct, but the agent did not display or explicitly confirm the chosen row in its final step.

### world_clusters

**Tool calling: passed.** The agent filtered fires.parquet to the VIIRS satellites VJ1 and VJ2 (680,723 detections). It built links with a grid-binned self-join using haversine ≤1 km and |Δt| ≤ 43200 s, computed connected components by iterative min-label propagation in SQL until no edge crossed two labels, and reported all 45 clusters of 300 or more with counts and FRP in MW. The run passed. ($0.52, 13 requests, 2.0 min)
- Right: Checked the satellite codes and correctly took VJ1 and VJ2 as the VIIRS detections, excluding MA and MT.
- Right: Converted frp_kw to MW by dividing by 1000.
- Right: Replaced the 30-second timeout of the range-join version with an equi-join on neighbour grid cells (0.01° lat by 0.03° lon), which finished and produced 1,874,135 edges.
- Right: Verified convergence with a 'bad' count of edges whose endpoints had different labels, and kept iterating with a label-merge step until it reached 0.
- Right: Confirmed that frp_kw is an integer, so the kW-to-MW sums have no floating-point rounding issues.
- Right: Labels converged to the minimum fid, so the label equals the lowest detection id.
- Mistake: The longitude grid bins do not wrap across the antimeridian. It checked that only 2 detections have |lon| > 179.9, so the risk was small, but it never explicitly handled the wrap.
- Mistake: A 0.03° longitude bin is narrower than 1 km at latitudes above roughly 72.6°. The data's max latitude is 71.3°, so this was safe here, but by luck rather than design.
- Mistake: Label propagation was run in many manually repeated batches (about 25 iterations) rather than a loop or a faster algorithm, which wasted effort but stayed correct.

### cross_section

**Tool calling: passed.** The agent loaded catalogue A and computed cross-track and along-track distances with vector great-circle maths in DuckDB. It filtered to k='T' events with a magnitude within 150 km whose nearest point falls between the end points, then wrote a 1000x500 SVG with 25 circles. All 25 ids and coordinates match the expected answer, and the run passed. ($0.31, 6 requests, 41 s)
- Right: Read DATA.md first and checked the schema. It noticed that z is stored as negative metres (min z = -651657) and converted it correctly with y = -z/1000/700\*500.
- Right: Used exact spherical vector maths: the cross product for the pole, asin of the dot product for cross-track distance, and atan2 for the along-track angle. x was scaled by the along/total angle ratio, so the earth radius cancels out of the scaling.
- Right: Ran an exploratory query with a 200 km band and slack at the ends to check boundary sensitivity, then applied the exact filter (abs(xt)\<=150, 0\<=along\<=tot).
- Right: Filtered to event class k='T' and m not null, which follows the dataset conventions; the result matched the expected 25 ids.
- Right: Generated the circle elements in SQL so the coordinates were not hand-transcribed. Gridlines and labels carry no data-id, and the width and height attributes are set correctly.
- Mistake: The claim that no event sits near the 150 km limit was only partly checked: the exploratory output shows events at xt -135.18 and -160.15. This is not a real problem, since the margins are about 15 km.
- Mistake: Coordinates were rounded to 2 decimals, which is harmless compared with the expected 3 decimals.

### pair_map_hypo

**Tool calling: passed.** The agent loaded both catalogues in DuckDB, filtered them to the antimeridian-crossing area and the overlapping period, and built 67 candidate pairs using 3D hypocentre distance. Every candidate involved distinct events, so all were accepted. It wrote a 900x900 SVG with 158 features that matched the expected positions, and the run passed. ($0.78, 10 requests, 1.5 min)
- Right: Read DATA.md and the sample records first, then decoded catalogue B's day-of-year date plus seconds-of-day, its N/S/E/W suffixes, and catalogue A's scaled magnitude (m/100) and negative z in metres.
- Right: Handled the area crossing the 180° meridian with (lon>=160 or lon\<=-170), and shifted negative longitudes by +360 when projecting.
- Right: Computed hypocentre distance in 3D using radius minus depth, rather than epicentral distance only.
- Right: Checked that candidate aids and bids were each distinct (67/67/67), which shows greedy acceptance trivially accepts all candidates.
- Right: Computed the great-circle midpoint by summing unit vectors, which matches the expected pair coordinates.
- Right: Restricted catalogue A to k='T' earthquakes, and confirmed that every catalogue B event in the area is class T.
- Right: Ran a sanity query for near-miss pairs outside the candidate set.
- Mistake: The overlap period was set by hand to cutoffs rounded to the minute (2026-10-26 16:00 to 2026-11-25 15:36) instead of the exact min/max timestamps of catalogue A. It happened to give the right result, but it was fragile.
- Mistake: The SVG content was pasted manually from query output into write_file, which risks transcription errors, though none occurred.
