{"record":{"id":"7f12636ae48bf2eb","repo":"zeroclaw-labs/zeroclaw","slug":"wttr-in-could-not-resolve-location-location-t","errorCode":null,"errorMessage":"wttr.in could not resolve location '{location}'. Try a city name, airport code, GPS coordinates (lat,lon), or zip code.","messagePattern":"wttr\\.in could not resolve location '(.+?)'\\. Try a city name, airport code, GPS coordinates \\(lat,lon\\), or zip code\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-tools/src/weather_tool.rs","lineNumber":171,"sourceCode":"        let builder =\n            zeroclaw_config::schema::apply_runtime_proxy_to_builder(builder, \"tool.weather\");\n        let client = builder.build()?;\n\n        let response = client.get(&url).send().await?;\n        let status = response.status();\n\n        if !status.is_success() {\n            anyhow::bail!(\n                \"wttr.in returned HTTP {status} for location '{location}'. \\\n                 Check that the location is valid.\"\n            );\n        }\n\n        let body = response.text().await?;\n\n        // wttr.in returns a plain-text error string (not JSON) for unknown locations.\n        if !body.trim_start().starts_with('{') {\n            anyhow::bail!(\n                \"wttr.in could not resolve location '{location}'. \\\n                 Try a city name, airport code, GPS coordinates (lat,lon), or zip code.\"\n            );\n        }\n\n        let parsed: WttrResponse = serde_json::from_str(&body).map_err(|e| {\n            ::zeroclaw_log::record!(\n                WARN,\n                ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Fail)\n                    .with_outcome(::zeroclaw_log::EventOutcome::Failure)\n                    .with_attrs(::serde_json::json!({\"error\": format!(\"{}\", e)})),\n                \"weather_tool: failed to parse wttr.in response\"\n            );\n            anyhow::Error::msg(format!(\"Failed to parse wttr.in response: {e}\"))\n        })?;\n\n        Ok(parsed)\n    }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-tools/src/weather_tool.rs#L153-L189","documentation":"wttr.in sometimes reports unknown locations with HTTP 200 but a plain-text body instead of JSON. The weather tool detects this by checking whether the body starts with '{' and bails with guidance on accepted location formats, since the JSON parse would otherwise produce a confusing error.","triggerScenarios":"Location strings like \"xyzzy\", made-up place names, malformed GPS (\"48.85;2.35\"), wrong-format zip codes, or IATA codes that are not airport codes; anything wttr.in cannot geocode but answers softly.","commonSituations":"Free-text user input passed straight to the tool (typos, business names, addresses); assuming any string is geocodable; using comma formats wttr.in does not accept.","solutions":["Use a recognized form: city name (\"Paris\"), IATA airport code (\"LHR\"), GPS as \"lat,lon\" (\"48.85,2.35\"), or a zip code (\"94105\")","Validate/normalize user-supplied locations before calling the tool (spell-check or your own geocoder)","On this error, fall back to a broader query like the containing city"],"exampleFix":"// before\n{\"location\":\"Main St 123 Springfield\"}  // could not resolve\n// after\n{\"location\":\"Springfield\"}","handlingStrategy":"validation","validationCode":"fn valid_wttr_location(loc: &str) -> bool {\n    let l = loc.trim();\n    !l.is_empty()\n        && (l.chars().all(|c| c.is_alphanumeric() || c.is_whitespace() || c == \",\" || c == '-'))\n        && !l.contains(\";;\")\n}","typeGuard":null,"tryCatchPattern":"Err(e) if e.to_string().starts_with(\"wttr.in could not resolve\") => {\n    // downgrade to a broader query (city only) or prompt the user; do not retry the same string\n}","preventionTips":["Validate free-text locations before calling the tool","Keep a small alias map for commonly misspelled local places","Prefer GPS coordinates or IATA codes for programmatic callers"],"tags":["weather","geocoding","validation","wttr"],"backgroundTag":"location-not-found","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}