MCPcopy Create free account
hub / github.com/AI45Lab/Code / program_options_normalize_to_script_tool_contract

Function program_options_normalize_to_script_tool_contract

sdk/python/src/lib.rs:7354–7375  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7352
7353 #[test]
7354 fn program_options_normalize_to_script_tool_contract() {
7355 pyo3::prepare_freethreaded_python();
7356 Python::with_gil(|py| {
7357 let dict = PyDict::new(py);
7358 dict.set_item(
7359 "source",
7360 "async function run(ctx, inputs) { return inputs; }",
7361 )
7362 .unwrap();
7363 dict.set_item(
7364 "inputs",
7365 serde_json::json!({ "needle": "auth" }).to_string(),
7366 )
7367 .unwrap();
7368 dict.set_item("allowedTools", vec!["grep", "read"]).unwrap();
7369
7370 let args = normalize_program_script_options(&dict).unwrap();
7371 assert_eq!(args["type"], "script");
7372 assert_eq!(args["language"], "javascript");
7373 assert_eq!(args["allowed_tools"], serde_json::json!(["grep", "read"]));
7374 });
7375 }
7376
7377 #[test]
7378 fn mcp_config_object_accepts_nested_transport_and_timeout_ms() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected