{"record":{"id":"a36071f80288b7eb","repo":"tinyhumansai/openhuman","slug":"missing-required-parameter-from-currency","errorCode":null,"errorMessage":"Missing required parameter: from_currency","messagePattern":"Missing required parameter: from_currency","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/tools/stock_prices.rs","lineNumber":258,"sourceCode":"                    \"type\": \"string\",\n                    \"description\": \"Source currency (fiat or crypto), e.g. BTC, ETH, USD, EUR\"\n                },\n                \"to_currency\": {\n                    \"type\": \"string\",\n                    \"description\": \"Target currency, e.g. USD\"\n                }\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);","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/tools/stock_prices.rs#L240-L276","documentation":"Currency conversion tool guard: the required 'from_currency' argument is missing, not a string, or blank. Fiat or crypto source currency codes (BTC, ETH, USD, EUR) are expected; to_currency is checked separately.","triggerScenarios":"Thrown at src/openhuman/integrations/tools/stock_prices.rs:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply from_currency as a currency code string, e.g. 'BTC'","Ensure both from_currency and to_currency are provided in the same call"],"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"}