{"record":{"id":"b28d6c14f0c0f72e","repo":"tinyhumansai/openhuman","slug":"missing-required-parameter-commodity","errorCode":null,"errorMessage":"Missing required parameter: commodity","messagePattern":"Missing required parameter: commodity","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/tools/stock_prices.rs","lineNumber":542,"sourceCode":"                \"limit\": {\n                    \"type\": \"integer\",\n                    \"description\": \"Max points (default 30)\",\n                    \"minimum\": 1,\n                    \"maximum\": 1000,\n                    \"default\": 30\n                }\n            },\n            \"required\": [\"commodity\"]\n        })\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let commodity = args\n            .get(\"commodity\")\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: commodity\"))?;\n\n        let mut body = json!({ \"commodity\": commodity });\n        if let Some(i) = args.get(\"interval\").and_then(|v| v.as_str()) {\n            body[\"interval\"] = json!(i);\n        }\n        if let Some(l) = args.get(\"limit\").and_then(|v| v.as_u64()) {\n            body[\"limit\"] = json!(l.clamp(1, 1000));\n        }\n\n        tracing::info!(\"[stock_commodity] {}\", commodity);\n\n        match self\n            .client\n            .post::<CommodityResponse>(PATH_COMMODITY, &body)\n            .await\n        {\n            Ok(resp) => {\n                let s = &resp.series;","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/tools/stock_prices.rs#L524-L560","documentation":"Required-parameter guard in the commodity-price tool's execute: `commodity` is missing, non-string, or trims to empty. Schema-required; fires before the price-history request, so the caller must name the commodity (e.g. a symbol from the tool's accepted set).","triggerScenarios":"Thrown at src/openhuman/integrations/tools/stock_prices.rs:542 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a non-empty commodity name supported by the prices provider","Check the tool schema's commodity description for accepted values"],"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"}