{"record":{"id":"583a08eea1e984a1","repo":"tinyhumansai/openhuman","slug":"missing-required-parameter-to-currency","errorCode":null,"errorMessage":"Missing required parameter: to_currency","messagePattern":"Missing required parameter: to_currency","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/tools/stock_prices.rs","lineNumber":264,"sourceCode":"                }\n            },\n            \"required\": [\"from_currency\", \"to_currency\"]\n        })\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let from = args\n            .get(\"from_currency\")\n            .and_then(|v| v.as_str())\n            .map(str::trim)\n            .filter(|s| !s.is_empty())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter: from_currency\"))?;\n        let to = args\n            .get(\"to_currency\")\n            .and_then(|v| v.as_str())\n            .map(str::trim)\n            .filter(|s| !s.is_empty())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter: to_currency\"))?;\n\n        tracing::info!(\"[stock_exchange_rate] {}->{}\", from, to);\n\n        let body = json!({ \"fromCurrency\": from, \"toCurrency\": to });\n        match self\n            .client\n            .post::<ExchangeRateResponse>(PATH_EXCHANGE_RATE, &body)\n            .await\n        {\n            Ok(resp) => {\n                let r = &resp.rate;\n                let mut out = format!(\"{}/{} = {}\\n\", r.from_currency, r.to_currency, r.rate);\n                if let Some(bid) = r.bid {\n                    out.push_str(&format!(\"  bid {}\\n\", bid));\n                }\n                if let Some(ask) = r.ask {\n                    out.push_str(&format!(\"  ask {}\\n\", ask));\n                }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/tools/stock_prices.rs#L246-L282","documentation":"Required-parameter guard in the currency-exchange tool's execute: `to_currency` (or, on the preceding line, `from_currency`) is missing, non-string, or blank after trimming. Both are schema-required; this fires before the FX rate lookup when either side of the conversion pair is absent.","triggerScenarios":"Thrown at src/openhuman/integrations/tools/stock_prices.rs:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply to_currency as a currency code string, e.g. 'USD'","Check for typos in the to_currency key name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}