{"record":{"id":"2250ca829526b9cb","repo":"tinyhumansai/openhuman","slug":"missing-required-number-argument-amount-usd","errorCode":null,"errorMessage":"missing required number argument `amount_usd`","messagePattern":"missing required number argument `amount_usd`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/hosted/billing/tools.rs","lineNumber":225,"sourceCode":"            \"type\": \"object\",\n            \"properties\": {\n                \"amount_usd\": { \"type\": \"number\", \"minimum\": 0 },\n                \"gateway\": { \"type\": \"string\" }\n            },\n            \"required\": [\"amount_usd\"]\n        })\n    }\n    fn permission_level(&self) -> PermissionLevel {\n        PermissionLevel::Write\n    }\n    fn external_effect(&self) -> bool {\n        true\n    }\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let amount = args\n            .get(\"amount_usd\")\n            .and_then(Value::as_f64)\n            .ok_or_else(|| anyhow::anyhow!(\"missing required number argument `amount_usd`\"))?;\n        let gateway = args\n            .get(\"gateway\")\n            .and_then(Value::as_str)\n            .map(str::to_string);\n        emit!(\n            billing::top_up_credits(&self.config, amount, gateway).await,\n            \"billing_top_up_credits\"\n        )\n    }\n}\n\n/// Create a Coinbase crypto charge.\npub struct BillingCoinbaseChargeTool {\n    config: Arc<Config>,\n}\nimpl BillingCoinbaseChargeTool {\n    pub fn new(config: Arc<Config>) -> Self {\n        Self { config }","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/hosted/billing/tools.rs#L207-L243","documentation":"A money-moving billing tool (e.g. top-up) was invoked without the required `amount_usd` number (absent or not JSON number). Guard on the tool arguments before any external payment effect happens; the schema declares amount_usd required with minimum 0.","triggerScenarios":"Thrown at src/openhuman/hosted/billing/tools.rs:225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass amount_usd as a non-negative number"],"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"}