tooluniverse 1.0.5__py3-none-any.whl → 1.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tooluniverse might be problematic. Click here for more details.
- tooluniverse/__init__.py +70 -0
- tooluniverse/agentic_tool.py +121 -15
- tooluniverse/arxiv_tool.py +109 -0
- tooluniverse/base_tool.py +174 -25
- tooluniverse/biorxiv_tool.py +116 -0
- tooluniverse/cellosaurus_tool.py +1332 -0
- tooluniverse/compose_scripts/enhanced_multi_agent_literature_search.py +310 -0
- tooluniverse/compose_scripts/multi_agent_literature_search.py +794 -0
- tooluniverse/compose_scripts/tool_graph_generation.py +68 -35
- tooluniverse/compose_scripts/tool_metadata_generator.py +205 -105
- tooluniverse/compose_tool.py +93 -8
- tooluniverse/core_tool.py +155 -0
- tooluniverse/crossref_tool.py +158 -0
- tooluniverse/data/agentic_tools.json +1271 -1179
- tooluniverse/data/alphafold_tools.json +356 -105
- tooluniverse/data/arxiv_tools.json +94 -0
- tooluniverse/data/biorxiv_tools.json +75 -0
- tooluniverse/data/cellosaurus_tools.json +260 -0
- tooluniverse/data/chembl_tools.json +27 -12
- tooluniverse/data/clinicaltrials_gov_tools.json +377 -302
- tooluniverse/data/compose_tools.json +123 -16
- tooluniverse/data/core_tools.json +113 -0
- tooluniverse/data/crossref_tools.json +138 -0
- tooluniverse/data/dailymed_tools.json +17 -3
- tooluniverse/data/dataset_tools.json +1031 -588
- tooluniverse/data/dblp_tools.json +144 -0
- tooluniverse/data/disease_target_score_tools.json +20 -10
- tooluniverse/data/doaj_tools.json +140 -0
- tooluniverse/data/embedding_tools.json +362 -299
- tooluniverse/data/enrichr_tools.json +34 -27
- tooluniverse/data/europe_pmc_tools.json +108 -16
- tooluniverse/data/fatcat_tools.json +77 -0
- tooluniverse/data/fda_drug_adverse_event_tools.json +1061 -445
- tooluniverse/data/fda_drug_labeling_tools.json +6858 -6901
- tooluniverse/data/finder_tools.json +32 -37
- tooluniverse/data/gene_ontology_tools.json +19 -7
- tooluniverse/data/gwas_tools.json +1720 -959
- tooluniverse/data/hal_tools.json +75 -0
- tooluniverse/data/hpa_tools.json +53 -14
- tooluniverse/data/humanbase_tools.json +51 -43
- tooluniverse/data/idmap_tools.json +76 -70
- tooluniverse/data/literature_search_tools.json +306 -0
- tooluniverse/data/mcp_client_tools_example.json +122 -107
- tooluniverse/data/medlineplus_tools.json +50 -10
- tooluniverse/data/medrxiv_tools.json +75 -0
- tooluniverse/data/molecule_2d_tools.json +134 -0
- tooluniverse/data/molecule_3d_tools.json +164 -0
- tooluniverse/data/monarch_tools.json +112 -110
- tooluniverse/data/odphp_tools.json +389 -119
- tooluniverse/data/openaire_tools.json +95 -0
- tooluniverse/data/openalex_tools.json +100 -31
- tooluniverse/data/opentarget_tools.json +1457 -1372
- tooluniverse/data/osf_preprints_tools.json +81 -0
- tooluniverse/data/packages/bioinformatics_core_tools.json +40 -10
- tooluniverse/data/packages/cheminformatics_tools.json +20 -5
- tooluniverse/data/packages/genomics_tools.json +36 -9
- tooluniverse/data/packages/machine_learning_tools.json +36 -9
- tooluniverse/data/packages/scientific_computing_tools.json +20 -5
- tooluniverse/data/packages/single_cell_tools.json +20 -5
- tooluniverse/data/packages/structural_biology_tools.json +16 -4
- tooluniverse/data/packages/visualization_tools.json +20 -5
- tooluniverse/data/pmc_tools.json +117 -0
- tooluniverse/data/protein_structure_3d_tools.json +138 -0
- tooluniverse/data/pubchem_tools.json +37 -12
- tooluniverse/data/pubmed_tools.json +133 -0
- tooluniverse/data/pubtator_tools.json +68 -60
- tooluniverse/data/rcsb_pdb_tools.json +1532 -1221
- tooluniverse/data/semantic_scholar_tools.json +55 -22
- tooluniverse/data/special_tools.json +8 -6
- tooluniverse/data/tool_composition_tools.json +112 -82
- tooluniverse/data/unified_guideline_tools.json +707 -0
- tooluniverse/data/unpaywall_tools.json +86 -0
- tooluniverse/data/url_fetch_tools.json +102 -82
- tooluniverse/data/uspto_tools.json +49 -30
- tooluniverse/data/wikidata_sparql_tools.json +45 -0
- tooluniverse/data/xml_tools.json +3274 -3113
- tooluniverse/data/zenodo_tools.json +90 -0
- tooluniverse/dblp_tool.py +132 -0
- tooluniverse/default_config.py +30 -0
- tooluniverse/doaj_tool.py +183 -0
- tooluniverse/doctor.py +48 -0
- tooluniverse/europe_pmc_tool.py +132 -17
- tooluniverse/exceptions.py +170 -0
- tooluniverse/execute_function.py +825 -342
- tooluniverse/fatcat_tool.py +65 -0
- tooluniverse/generate_tools.py +198 -0
- tooluniverse/hal_tool.py +77 -0
- tooluniverse/llm_clients.py +283 -20
- tooluniverse/mcp_tool_registry.py +4 -1
- tooluniverse/medrxiv_tool.py +116 -0
- tooluniverse/memory_manager.py +166 -0
- tooluniverse/molecule_2d_tool.py +274 -0
- tooluniverse/molecule_3d_tool.py +441 -0
- tooluniverse/odphp_tool.py +49 -14
- tooluniverse/openaire_tool.py +130 -0
- tooluniverse/openalex_tool.py +34 -0
- tooluniverse/osf_preprints_tool.py +67 -0
- tooluniverse/pmc_tool.py +179 -0
- tooluniverse/protein_structure_3d_tool.py +295 -0
- tooluniverse/pubmed_tool.py +173 -0
- tooluniverse/remote/boltz/boltz_mcp_server.py +3 -1
- tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +3 -1
- tooluniverse/semantic_scholar_tool.py +40 -10
- tooluniverse/smcp.py +228 -263
- tooluniverse/smcp_server.py +97 -55
- tooluniverse/tool_registry.py +35 -3
- tooluniverse/tools/ADMETAI_predict_BBB_penetrance.py +46 -0
- tooluniverse/tools/ADMETAI_predict_CYP_interactions.py +46 -0
- tooluniverse/tools/ADMETAI_predict_bioavailability.py +46 -0
- tooluniverse/tools/ADMETAI_predict_clearance_distribution.py +49 -0
- tooluniverse/tools/ADMETAI_predict_nuclear_receptor_activity.py +49 -0
- tooluniverse/tools/ADMETAI_predict_physicochemical_properties.py +49 -0
- tooluniverse/tools/ADMETAI_predict_solubility_lipophilicity_hydration.py +49 -0
- tooluniverse/tools/ADMETAI_predict_stress_response.py +46 -0
- tooluniverse/tools/ADMETAI_predict_toxicity.py +46 -0
- tooluniverse/tools/AdvancedCodeQualityAnalyzer.py +63 -0
- tooluniverse/tools/AdverseEventICDMapper.py +46 -0
- tooluniverse/tools/AdverseEventPredictionQuestionGenerator.py +52 -0
- tooluniverse/tools/AdverseEventPredictionQuestionGeneratorWithContext.py +59 -0
- tooluniverse/tools/ArXiv_search_papers.py +63 -0
- tooluniverse/tools/ArgumentDescriptionOptimizer.py +55 -0
- tooluniverse/tools/BioRxiv_search_preprints.py +52 -0
- tooluniverse/tools/BiomarkerDiscoveryWorkflow.py +55 -0
- tooluniverse/tools/CORE_search_papers.py +67 -0
- tooluniverse/tools/CallAgent.py +46 -0
- tooluniverse/tools/ChEMBL_search_similar_molecules.py +59 -0
- tooluniverse/tools/CodeOptimizer.py +55 -0
- tooluniverse/tools/CodeQualityAnalyzer.py +71 -0
- tooluniverse/tools/ComprehensiveDrugDiscoveryPipeline.py +49 -0
- tooluniverse/tools/Crossref_search_works.py +55 -0
- tooluniverse/tools/DBLP_search_publications.py +52 -0
- tooluniverse/tools/DOAJ_search_articles.py +55 -0
- tooluniverse/tools/DailyMed_get_spl_by_setid.py +52 -0
- tooluniverse/tools/DailyMed_search_spls.py +79 -0
- tooluniverse/tools/DataAnalysisValidityReviewer.py +49 -0
- tooluniverse/tools/DescriptionAnalyzer.py +55 -0
- tooluniverse/tools/DescriptionQualityEvaluator.py +59 -0
- tooluniverse/tools/DomainExpertValidator.py +63 -0
- tooluniverse/tools/DrugSafetyAnalyzer.py +59 -0
- tooluniverse/tools/EthicalComplianceReviewer.py +49 -0
- tooluniverse/tools/EuropePMC_Guidelines_Search.py +52 -0
- tooluniverse/tools/EuropePMC_search_articles.py +52 -0
- tooluniverse/tools/ExperimentalDesignScorer.py +55 -0
- tooluniverse/tools/FAERS_count_additive_administration_routes.py +52 -0
- tooluniverse/tools/FAERS_count_additive_adverse_reactions.py +71 -0
- tooluniverse/tools/FAERS_count_additive_event_reports_by_country.py +63 -0
- tooluniverse/tools/FAERS_count_additive_reaction_outcomes.py +63 -0
- tooluniverse/tools/FAERS_count_additive_reports_by_reporter_country.py +63 -0
- tooluniverse/tools/FAERS_count_additive_seriousness_classification.py +63 -0
- tooluniverse/tools/FAERS_count_country_by_drug_event.py +63 -0
- tooluniverse/tools/FAERS_count_death_related_by_drug.py +49 -0
- tooluniverse/tools/FAERS_count_drug_routes_by_event.py +52 -0
- tooluniverse/tools/FAERS_count_drugs_by_drug_event.py +63 -0
- tooluniverse/tools/FAERS_count_outcomes_by_drug_event.py +63 -0
- tooluniverse/tools/FAERS_count_patient_age_distribution.py +49 -0
- tooluniverse/tools/FAERS_count_reactions_by_drug_event.py +71 -0
- tooluniverse/tools/FAERS_count_reportercountry_by_drug_event.py +63 -0
- tooluniverse/tools/FAERS_count_seriousness_by_drug_event.py +63 -0
- tooluniverse/tools/FDA_get_abuse_dependence_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_abuse_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_accessories_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_active_ingredient_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_adverse_reactions_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_alarms_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_animal_pharmacology_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_assembly_installation_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_boxed_warning_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_brand_name_generic_name.py +52 -0
- tooluniverse/tools/FDA_get_calibration_instructions_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_carcinogenic_mutagenic_fertility_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_child_safety_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_clinical_pharmacology_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_clinical_studies_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_contact_for_questions_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_contraindications_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_controlled_substance_DEA_schedule_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_dear_health_care_provider_letter_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_dependence_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_disposal_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_do_not_use_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_document_id_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_dosage_and_storage_information_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_dosage_forms_and_strengths_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_drug_generic_name.py +46 -0
- tooluniverse/tools/FDA_get_drug_interactions_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_SPL_ID.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_adverse_reaction.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_calibration_instructions.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_dependence_info.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_document_id.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_dosage_info.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_environmental_warning.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_inactive_ingredient.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_info_on_conditions_for_doctor_consultation.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_labor_and_delivery_info.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_microbiology.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_other_safety_info.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_pharmacodynamics.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_pharmacogenomics.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_precautions.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_pregnancy_or_breastfeeding_info.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_principal_display_panel.py +59 -0
- tooluniverse/tools/FDA_get_drug_name_by_reference.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_set_id.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_stop_use_info.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_storage_and_handling_info.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_by_warnings.py +55 -0
- tooluniverse/tools/FDA_get_drug_name_from_patient_package_insert.py +59 -0
- tooluniverse/tools/FDA_get_drug_names_by_abuse_dependence_info.py +55 -0
- tooluniverse/tools/FDA_get_drug_names_by_abuse_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_accessories.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_active_ingredient.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_alarm.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_animal_pharmacology_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_application_number_NDC_number.py +59 -0
- tooluniverse/tools/FDA_get_drug_names_by_assembly_installation_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_boxed_warning.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_child_safety_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_clinical_pharmacology.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_clinical_studies.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_consulting_doctor_pharmacist_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_contraindications.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_controlled_substance_DEA_schedule.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_dear_health_care_provider_letter_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_disposal_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_dosage_forms_and_strengths_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_drug_interactions.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_effective_time.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_food_safety_warnings.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_general_precautions.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_geriatric_use.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_health_claim.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_indication.py +55 -0
- tooluniverse/tools/FDA_get_drug_names_by_info_for_nursing_mothers.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_information_for_owners_or_caregivers.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_ingredient.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_instructions_for_use.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_lab_test_interference.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_lab_tests.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_mechanism_of_action.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_medication_guide.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_nonclinical_toxicology_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_nonteratogenic_effects.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_overdosage_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_pediatric_use.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_pharmacokinetics.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_population_use.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_pregnancy_effects_info.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_residue_warning.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_risk.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_route.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_safe_handling_warning.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_safety_summary.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_spl_indexing_data_elements.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_teratogenic_effects.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_user_safety_warning.py +63 -0
- tooluniverse/tools/FDA_get_drug_names_by_warnings_and_cautions.py +63 -0
- tooluniverse/tools/FDA_get_drugs_by_carcinogenic_mutagenic_fertility.py +63 -0
- tooluniverse/tools/FDA_get_effective_time_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_environmental_warning_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_general_precautions_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_geriatric_use_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_health_claims_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_inactive_ingredient_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_indications_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_info_for_nursing_mothers_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_info_for_patients_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_info_on_conditions_for_doctor_consultation_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_info_on_consulting_doctor_pharmacist_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_information_for_owners_or_caregivers_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_ingredients_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_instructions_for_use_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_lab_test_interference_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_lab_tests_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_labor_and_delivery_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_manufacturer_name_NDC_number_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_mechanism_of_action_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_medication_guide_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_microbiology_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_nonclinical_toxicology_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_nonteratogenic_effects_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_other_safety_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_overdosage_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_patient_package_insert_from_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_pediatric_use_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_pharmacodynamics_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_pharmacogenomics_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_pharmacokinetics_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_population_use_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_precautions_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_pregnancy_effects_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_pregnancy_or_breastfeeding_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_principal_display_panel_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_purpose_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_recent_changes_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_reference_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_residue_warning_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_risk_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_route_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_safe_handling_warnings_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_safety_summary_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_spl_indexing_data_elements_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_spl_unclassified_section_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_stop_use_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_storage_and_handling_info_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_teratogenic_effects_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_user_safety_warning_by_drug_names.py +55 -0
- tooluniverse/tools/FDA_get_warnings_and_cautions_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_warnings_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_get_when_using_info.py +55 -0
- tooluniverse/tools/FDA_retrieve_device_use_by_drug_name.py +55 -0
- tooluniverse/tools/FDA_retrieve_drug_name_by_device_use.py +59 -0
- tooluniverse/tools/FDA_retrieve_drug_names_by_patient_medication_info.py +55 -0
- tooluniverse/tools/FDA_retrieve_patient_medication_info_by_drug_name.py +55 -0
- tooluniverse/tools/Fatcat_search_scholar.py +52 -0
- tooluniverse/tools/Finish.py +44 -0
- tooluniverse/tools/GO_get_annotations_for_gene.py +46 -0
- tooluniverse/tools/GO_get_genes_for_term.py +55 -0
- tooluniverse/tools/GO_get_term_by_id.py +46 -0
- tooluniverse/tools/GO_get_term_details.py +46 -0
- tooluniverse/tools/GO_search_terms.py +46 -0
- tooluniverse/tools/HAL_search_archive.py +52 -0
- tooluniverse/tools/HPA_get_biological_processes_by_gene.py +52 -0
- tooluniverse/tools/HPA_get_cancer_prognostics_by_gene.py +49 -0
- tooluniverse/tools/HPA_get_comparative_expression_by_gene_and_cellline.py +52 -0
- tooluniverse/tools/HPA_get_comprehensive_gene_details_by_ensembl_id.py +63 -0
- tooluniverse/tools/HPA_get_contextual_biological_process_analysis.py +52 -0
- tooluniverse/tools/HPA_get_disease_expression_by_gene_tissue_disease.py +59 -0
- tooluniverse/tools/HPA_get_gene_basic_info_by_ensembl_id.py +49 -0
- tooluniverse/tools/HPA_get_gene_tsv_data_by_ensembl_id.py +49 -0
- tooluniverse/tools/HPA_get_protein_interactions_by_gene.py +49 -0
- tooluniverse/tools/HPA_get_rna_expression_by_source.py +59 -0
- tooluniverse/tools/HPA_get_rna_expression_in_specific_tissues.py +52 -0
- tooluniverse/tools/HPA_get_subcellular_location.py +46 -0
- tooluniverse/tools/HPA_search_genes_by_query.py +49 -0
- tooluniverse/tools/HypothesisGenerator.py +63 -0
- tooluniverse/tools/LabelGenerator.py +67 -0
- tooluniverse/tools/LiteratureContextReviewer.py +55 -0
- tooluniverse/tools/LiteratureSearchTool.py +49 -0
- tooluniverse/tools/MedRxiv_search_preprints.py +52 -0
- tooluniverse/tools/MedicalLiteratureReviewer.py +71 -0
- tooluniverse/tools/MedicalTermNormalizer.py +46 -0
- tooluniverse/tools/MedlinePlus_connect_lookup_by_code.py +67 -0
- tooluniverse/tools/MedlinePlus_get_genetics_condition_by_name.py +52 -0
- tooluniverse/tools/MedlinePlus_get_genetics_gene_by_name.py +52 -0
- tooluniverse/tools/MedlinePlus_get_genetics_index.py +44 -0
- tooluniverse/tools/MedlinePlus_search_topics_by_keyword.py +55 -0
- tooluniverse/tools/MethodologyRigorReviewer.py +49 -0
- tooluniverse/tools/MultiAgentLiteratureSearch.py +59 -0
- tooluniverse/tools/NICE_Clinical_Guidelines_Search.py +52 -0
- tooluniverse/tools/NICE_Guideline_Full_Text.py +46 -0
- tooluniverse/tools/NoveltySignificanceReviewer.py +59 -0
- tooluniverse/tools/OSF_search_preprints.py +59 -0
- tooluniverse/tools/OSL_get_efo_id_by_disease_name.py +46 -0
- tooluniverse/tools/OpenAIRE_search_publications.py +55 -0
- tooluniverse/tools/OpenAlex_Guidelines_Search.py +63 -0
- tooluniverse/tools/OpenTargets_drug_pharmacogenomics_data.py +52 -0
- tooluniverse/tools/OpenTargets_get_approved_indications_by_drug_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_associated_diseases_by_drug_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_associated_drugs_by_disease_efoId.py +52 -0
- tooluniverse/tools/OpenTargets_get_associated_drugs_by_target_ensemblID.py +55 -0
- tooluniverse/tools/OpenTargets_get_associated_phenotypes_by_disease_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_associated_targets_by_disease_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_associated_targets_by_drug_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_biological_mouse_models_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_chemical_probes_by_target_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_ancestors_parents_by_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_descendants_children_by_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_description_by_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_id_description_by_name.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_ids_by_efoId.py +46 -0
- tooluniverse/tools/OpenTargets_get_disease_ids_by_name.py +46 -0
- tooluniverse/tools/OpenTargets_get_disease_locations_by_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_synonyms_by_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_disease_therapeutic_areas_by_efoId.py +49 -0
- tooluniverse/tools/OpenTargets_get_diseases_phenotypes_by_target_ensembl.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_adverse_events_by_chemblId.py +52 -0
- tooluniverse/tools/OpenTargets_get_drug_approval_status_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_chembId_by_generic_name.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_description_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_id_description_by_name.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_indications_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_mechanisms_of_action_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_synonyms_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_trade_names_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_warnings_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_drug_withdrawn_blackbox_status_by_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_gene_ontology_terms_by_goID.py +49 -0
- tooluniverse/tools/OpenTargets_get_known_drugs_by_drug_chemblId.py +49 -0
- tooluniverse/tools/OpenTargets_get_parent_child_molecules_by_drug_chembl_ID.py +49 -0
- tooluniverse/tools/OpenTargets_get_publications_by_disease_efoId.py +71 -0
- tooluniverse/tools/OpenTargets_get_publications_by_drug_chemblId.py +71 -0
- tooluniverse/tools/OpenTargets_get_publications_by_target_ensemblID.py +71 -0
- tooluniverse/tools/OpenTargets_get_similar_entities_by_disease_efoId.py +55 -0
- tooluniverse/tools/OpenTargets_get_similar_entities_by_drug_chemblId.py +55 -0
- tooluniverse/tools/OpenTargets_get_similar_entities_by_target_ensemblID.py +55 -0
- tooluniverse/tools/OpenTargets_get_target_classes_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_constraint_info_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_enabling_packages_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_gene_ontology_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_genomic_location_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_homologues_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_id_description_by_name.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_interactions_by_ensemblID.py +52 -0
- tooluniverse/tools/OpenTargets_get_target_safety_profile_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_subcellular_locations_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_synonyms_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_get_target_tractability_by_ensemblID.py +49 -0
- tooluniverse/tools/OpenTargets_map_any_disease_id_to_all_other_ids.py +49 -0
- tooluniverse/tools/OpenTargets_multi_entity_search_by_query_string.py +59 -0
- tooluniverse/tools/OpenTargets_search_category_counts_by_query_string.py +49 -0
- tooluniverse/tools/OpenTargets_target_disease_evidence.py +52 -0
- tooluniverse/tools/OutputSummarizationComposer.py +71 -0
- tooluniverse/tools/PMC_search_papers.py +67 -0
- tooluniverse/tools/ProtocolOptimizer.py +49 -0
- tooluniverse/tools/PubChem_get_CID_by_SMILES.py +46 -0
- tooluniverse/tools/PubChem_get_CID_by_compound_name.py +46 -0
- tooluniverse/tools/PubChem_get_associated_patents_by_CID.py +46 -0
- tooluniverse/tools/PubChem_get_compound_2D_image_by_CID.py +52 -0
- tooluniverse/tools/PubChem_get_compound_properties_by_CID.py +46 -0
- tooluniverse/tools/PubChem_get_compound_synonyms_by_CID.py +46 -0
- tooluniverse/tools/PubChem_get_compound_xrefs_by_CID.py +52 -0
- tooluniverse/tools/PubChem_search_compounds_by_similarity.py +52 -0
- tooluniverse/tools/PubChem_search_compounds_by_substructure.py +49 -0
- tooluniverse/tools/PubMed_Guidelines_Search.py +55 -0
- tooluniverse/tools/PubMed_search_articles.py +55 -0
- tooluniverse/tools/PubTator3_EntityAutocomplete.py +59 -0
- tooluniverse/tools/PubTator3_LiteratureSearch.py +55 -0
- tooluniverse/tools/QuestionRephraser.py +52 -0
- tooluniverse/tools/Reactome_get_pathway_reactions.py +46 -0
- tooluniverse/tools/ReproducibilityTransparencyReviewer.py +49 -0
- tooluniverse/tools/ResultsInterpretationReviewer.py +55 -0
- tooluniverse/tools/ScientificTextSummarizer.py +59 -0
- tooluniverse/tools/SemanticScholar_search_papers.py +55 -0
- tooluniverse/tools/TRIP_Database_Guidelines_Search.py +55 -0
- tooluniverse/tools/TestCaseGenerator.py +46 -0
- tooluniverse/tools/ToolCompatibilityAnalyzer.py +59 -0
- tooluniverse/tools/ToolDescriptionOptimizer.py +67 -0
- tooluniverse/tools/ToolDiscover.py +63 -0
- tooluniverse/tools/ToolGraphComposer.py +71 -0
- tooluniverse/tools/ToolGraphGenerationPipeline.py +63 -0
- tooluniverse/tools/ToolImplementationGenerator.py +67 -0
- tooluniverse/tools/ToolMetadataGenerationPipeline.py +63 -0
- tooluniverse/tools/ToolMetadataGenerator.py +55 -0
- tooluniverse/tools/ToolMetadataStandardizer.py +52 -0
- tooluniverse/tools/ToolOptimizer.py +59 -0
- tooluniverse/tools/ToolOutputSummarizer.py +67 -0
- tooluniverse/tools/ToolQualityEvaluator.py +59 -0
- tooluniverse/tools/ToolRelationshipDetector.py +52 -0
- tooluniverse/tools/ToolSpecificationGenerator.py +67 -0
- tooluniverse/tools/ToolSpecificationOptimizer.py +63 -0
- tooluniverse/tools/Tool_Finder.py +67 -0
- tooluniverse/tools/Tool_Finder_Keyword.py +67 -0
- tooluniverse/tools/Tool_Finder_LLM.py +67 -0
- tooluniverse/tools/Tool_RAG.py +49 -0
- tooluniverse/tools/UniProt_get_alternative_names_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_disease_variants_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_entry_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_function_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_isoform_ids_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_organism_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_ptm_processing_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_recommended_name_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_sequence_by_accession.py +49 -0
- tooluniverse/tools/UniProt_get_subcellular_location_by_accession.py +49 -0
- tooluniverse/tools/Unpaywall_check_oa_status.py +52 -0
- tooluniverse/tools/WHO_Guideline_Full_Text.py +46 -0
- tooluniverse/tools/WHO_Guidelines_Search.py +52 -0
- tooluniverse/tools/Wikidata_SPARQL_query.py +52 -0
- tooluniverse/tools/WritingPresentationReviewer.py +49 -0
- tooluniverse/tools/Zenodo_search_records.py +59 -0
- tooluniverse/tools/__init__.py +1738 -0
- tooluniverse/tools/_shared_client.py +138 -0
- tooluniverse/tools/alphafold_get_annotations.py +52 -0
- tooluniverse/tools/alphafold_get_prediction.py +55 -0
- tooluniverse/tools/alphafold_get_summary.py +46 -0
- tooluniverse/tools/call_agentic_human.py +46 -0
- tooluniverse/tools/cancer_biomarkers_disease_target_score.py +52 -0
- tooluniverse/tools/cancer_gene_census_disease_target_score.py +52 -0
- tooluniverse/tools/cellosaurus_get_cell_line_info.py +55 -0
- tooluniverse/tools/cellosaurus_query_converter.py +52 -0
- tooluniverse/tools/cellosaurus_search_cell_lines.py +55 -0
- tooluniverse/tools/chembl_disease_target_score.py +52 -0
- tooluniverse/tools/dict_search.py +67 -0
- tooluniverse/tools/dili_search.py +67 -0
- tooluniverse/tools/diqt_search.py +67 -0
- tooluniverse/tools/disease_target_score.py +59 -0
- tooluniverse/tools/drugbank_filter_drugs_by_name.py +55 -0
- tooluniverse/tools/drugbank_full_search.py +67 -0
- tooluniverse/tools/drugbank_get_drug_basic_info_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_drug_chemistry_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_drug_interactions_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_drug_name_and_description_by_indication.py +63 -0
- tooluniverse/tools/drugbank_get_drug_name_and_description_by_pathway_name.py +63 -0
- tooluniverse/tools/drugbank_get_drug_name_and_description_by_target_name.py +63 -0
- tooluniverse/tools/drugbank_get_drug_name_description_pharmacology_by_mechanism_of_action.py +63 -0
- tooluniverse/tools/drugbank_get_drug_pathways_and_reactions_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_drug_products_by_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_drug_references_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_indications_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_pharmacology_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_safety_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_get_targets_by_drug_name_or_drugbank_id.py +63 -0
- tooluniverse/tools/drugbank_links_search.py +67 -0
- tooluniverse/tools/drugbank_vocab_filter.py +63 -0
- tooluniverse/tools/drugbank_vocab_search.py +67 -0
- tooluniverse/tools/embedding_database_add.py +63 -0
- tooluniverse/tools/embedding_database_create.py +71 -0
- tooluniverse/tools/embedding_database_load.py +63 -0
- tooluniverse/tools/embedding_database_search.py +67 -0
- tooluniverse/tools/embedding_sync_download.py +63 -0
- tooluniverse/tools/embedding_sync_upload.py +71 -0
- tooluniverse/tools/enrichr_gene_enrichment_analysis.py +52 -0
- tooluniverse/tools/europepmc_disease_target_score.py +52 -0
- tooluniverse/tools/eva_disease_target_score.py +52 -0
- tooluniverse/tools/eva_somatic_disease_target_score.py +52 -0
- tooluniverse/tools/expression_atlas_disease_target_score.py +52 -0
- tooluniverse/tools/extract_clinical_trial_adverse_events.py +59 -0
- tooluniverse/tools/extract_clinical_trial_outcomes.py +52 -0
- tooluniverse/tools/genomics_england_disease_target_score.py +52 -0
- tooluniverse/tools/get_HPO_ID_by_phenotype.py +55 -0
- tooluniverse/tools/get_albumentations_info.py +44 -0
- tooluniverse/tools/get_altair_info.py +44 -0
- tooluniverse/tools/get_anndata_info.py +49 -0
- tooluniverse/tools/get_arboreto_info.py +46 -0
- tooluniverse/tools/get_arxiv_info.py +46 -0
- tooluniverse/tools/get_ase_info.py +46 -0
- tooluniverse/tools/get_assembly_info_by_pdb_id.py +46 -0
- tooluniverse/tools/get_assembly_summary.py +46 -0
- tooluniverse/tools/get_astropy_info.py +44 -0
- tooluniverse/tools/get_binding_affinity_by_pdb_id.py +46 -0
- tooluniverse/tools/get_biopandas_info.py +49 -0
- tooluniverse/tools/get_biopython_info.py +49 -0
- tooluniverse/tools/get_bioservices_info.py +44 -0
- tooluniverse/tools/get_biotite_info.py +49 -0
- tooluniverse/tools/get_bokeh_info.py +44 -0
- tooluniverse/tools/get_brian2_info.py +44 -0
- tooluniverse/tools/get_cartopy_info.py +44 -0
- tooluniverse/tools/get_catboost_info.py +44 -0
- tooluniverse/tools/get_cellpose_info.py +49 -0
- tooluniverse/tools/get_cellrank_info.py +44 -0
- tooluniverse/tools/get_cellxgene_census_info.py +46 -0
- tooluniverse/tools/get_cftime_info.py +44 -0
- tooluniverse/tools/get_chem_comp_audit_info.py +46 -0
- tooluniverse/tools/get_chem_comp_charge_and_ambiguity.py +46 -0
- tooluniverse/tools/get_chembl_webresource_client_info.py +44 -0
- tooluniverse/tools/get_citation_info_by_pdb_id.py +46 -0
- tooluniverse/tools/get_clair3_info.py +46 -0
- tooluniverse/tools/get_clinical_trial_conditions_and_interventions.py +55 -0
- tooluniverse/tools/get_clinical_trial_descriptions.py +52 -0
- tooluniverse/tools/get_clinical_trial_eligibility_criteria.py +55 -0
- tooluniverse/tools/get_clinical_trial_locations.py +52 -0
- tooluniverse/tools/get_clinical_trial_outcome_measures.py +52 -0
- tooluniverse/tools/get_clinical_trial_references.py +52 -0
- tooluniverse/tools/get_clinical_trial_status_and_dates.py +52 -0
- tooluniverse/tools/get_cobra_info.py +46 -0
- tooluniverse/tools/get_cobrapy_info.py +46 -0
- tooluniverse/tools/get_cooler_info.py +49 -0
- tooluniverse/tools/get_core_refinement_statistics.py +46 -0
- tooluniverse/tools/get_cryosparc_tools_info.py +46 -0
- tooluniverse/tools/get_crystal_growth_conditions_by_pdb_id.py +49 -0
- tooluniverse/tools/get_crystallization_ph_by_pdb_id.py +46 -0
- tooluniverse/tools/get_crystallographic_properties_by_pdb_id.py +49 -0
- tooluniverse/tools/get_cupy_info.py +44 -0
- tooluniverse/tools/get_cyvcf2_info.py +49 -0
- tooluniverse/tools/get_dask_info.py +44 -0
- tooluniverse/tools/get_datamol_info.py +44 -0
- tooluniverse/tools/get_datashader_info.py +44 -0
- tooluniverse/tools/get_deepchem_info.py +49 -0
- tooluniverse/tools/get_deeppurpose_info.py +46 -0
- tooluniverse/tools/get_deeptools_info.py +46 -0
- tooluniverse/tools/get_deepxde_info.py +49 -0
- tooluniverse/tools/get_dendropy_info.py +44 -0
- tooluniverse/tools/get_descriptastorus_info.py +46 -0
- tooluniverse/tools/get_diffdock_info.py +46 -0
- tooluniverse/tools/get_dscribe_info.py +49 -0
- tooluniverse/tools/get_ec_number_by_entity_id.py +46 -0
- tooluniverse/tools/get_elephant_info.py +44 -0
- tooluniverse/tools/get_em_3d_fitting_and_reconstruction_details.py +49 -0
- tooluniverse/tools/get_emdb_ids_by_pdb_id.py +46 -0
- tooluniverse/tools/get_episcanpy_info.py +44 -0
- tooluniverse/tools/get_ete3_info.py +44 -0
- tooluniverse/tools/get_faiss_info.py +46 -0
- tooluniverse/tools/get_fanc_info.py +46 -0
- tooluniverse/tools/get_flask_info.py +46 -0
- tooluniverse/tools/get_flowio_info.py +46 -0
- tooluniverse/tools/get_flowkit_info.py +46 -0
- tooluniverse/tools/get_flowutils_info.py +46 -0
- tooluniverse/tools/get_freesasa_info.py +44 -0
- tooluniverse/tools/get_galpy_info.py +44 -0
- tooluniverse/tools/get_gene_name_by_entity_id.py +46 -0
- tooluniverse/tools/get_geopandas_info.py +44 -0
- tooluniverse/tools/get_gget_info.py +46 -0
- tooluniverse/tools/get_googlesearch_python_info.py +46 -0
- tooluniverse/tools/get_gseapy_info.py +49 -0
- tooluniverse/tools/get_h5py_info.py +46 -0
- tooluniverse/tools/get_harmony_pytorch_info.py +46 -0
- tooluniverse/tools/get_hmmlearn_info.py +46 -0
- tooluniverse/tools/get_holoviews_info.py +44 -0
- tooluniverse/tools/get_host_organism_by_pdb_id.py +46 -0
- tooluniverse/tools/get_htmd_info.py +44 -0
- tooluniverse/tools/get_hyperopt_info.py +49 -0
- tooluniverse/tools/get_igraph_info.py +49 -0
- tooluniverse/tools/get_imageio_info.py +44 -0
- tooluniverse/tools/get_imbalanced_learn_info.py +44 -0
- tooluniverse/tools/get_jcvi_info.py +46 -0
- tooluniverse/tools/get_joblib_info.py +44 -0
- tooluniverse/tools/get_joint_associated_diseases_by_HPO_ID_list.py +55 -0
- tooluniverse/tools/get_khmer_info.py +46 -0
- tooluniverse/tools/get_kipoiseq_info.py +44 -0
- tooluniverse/tools/get_lifelines_info.py +49 -0
- tooluniverse/tools/get_ligand_bond_count_by_pdb_id.py +46 -0
- tooluniverse/tools/get_ligand_smiles_by_chem_comp_id.py +49 -0
- tooluniverse/tools/get_lightgbm_info.py +44 -0
- tooluniverse/tools/get_loompy_info.py +46 -0
- tooluniverse/tools/get_mageck_info.py +46 -0
- tooluniverse/tools/get_matplotlib_info.py +49 -0
- tooluniverse/tools/get_mdanalysis_info.py +46 -0
- tooluniverse/tools/get_mdtraj_info.py +44 -0
- tooluniverse/tools/get_mne_info.py +44 -0
- tooluniverse/tools/get_molfeat_info.py +44 -0
- tooluniverse/tools/get_molvs_info.py +44 -0
- tooluniverse/tools/get_mordred_info.py +44 -0
- tooluniverse/tools/get_msprime_info.py +49 -0
- tooluniverse/tools/get_mudata_info.py +49 -0
- tooluniverse/tools/get_mutation_annotations_by_pdb_id.py +46 -0
- tooluniverse/tools/get_neo_info.py +44 -0
- tooluniverse/tools/get_netcdf4_info.py +44 -0
- tooluniverse/tools/get_networkx_info.py +46 -0
- tooluniverse/tools/get_nglview_info.py +44 -0
- tooluniverse/tools/get_nilearn_info.py +44 -0
- tooluniverse/tools/get_numba_info.py +46 -0
- tooluniverse/tools/get_numpy_info.py +46 -0
- tooluniverse/tools/get_oligosaccharide_descriptors_by_entity_id.py +49 -0
- tooluniverse/tools/get_openbabel_info.py +49 -0
- tooluniverse/tools/get_openchem_info.py +46 -0
- tooluniverse/tools/get_opencv_info.py +49 -0
- tooluniverse/tools/get_openmm_info.py +49 -0
- tooluniverse/tools/get_optlang_info.py +46 -0
- tooluniverse/tools/get_optuna_info.py +44 -0
- tooluniverse/tools/get_palantir_info.py +44 -0
- tooluniverse/tools/get_pandas_info.py +49 -0
- tooluniverse/tools/get_patsy_info.py +44 -0
- tooluniverse/tools/get_pdbfixer_info.py +46 -0
- tooluniverse/tools/get_phenotype_by_HPO_ID.py +46 -0
- tooluniverse/tools/get_pillow_info.py +44 -0
- tooluniverse/tools/get_plantcv_info.py +46 -0
- tooluniverse/tools/get_plip_info.py +46 -0
- tooluniverse/tools/get_plotly_info.py +44 -0
- tooluniverse/tools/get_poliastro_info.py +46 -0
- tooluniverse/tools/get_polymer_entity_annotations.py +49 -0
- tooluniverse/tools/get_polymer_entity_count_by_pdb_id.py +46 -0
- tooluniverse/tools/get_polymer_entity_ids_by_pdb_id.py +46 -0
- tooluniverse/tools/get_polymer_entity_type_by_entity_id.py +49 -0
- tooluniverse/tools/get_polymer_molecular_weight_by_entity_id.py +49 -0
- tooluniverse/tools/get_poretools_info.py +44 -0
- tooluniverse/tools/get_prody_info.py +46 -0
- tooluniverse/tools/get_protein_classification_by_pdb_id.py +49 -0
- tooluniverse/tools/get_protein_metadata_by_pdb_id.py +46 -0
- tooluniverse/tools/get_pubchempy_info.py +44 -0
- tooluniverse/tools/get_pybedtools_info.py +49 -0
- tooluniverse/tools/get_pybigwig_info.py +46 -0
- tooluniverse/tools/get_pydeseq2_info.py +46 -0
- tooluniverse/tools/get_pyensembl_info.py +44 -0
- tooluniverse/tools/get_pyephem_info.py +44 -0
- tooluniverse/tools/get_pyfaidx_info.py +49 -0
- tooluniverse/tools/get_pyfasta_info.py +44 -0
- tooluniverse/tools/get_pykalman_info.py +46 -0
- tooluniverse/tools/get_pyliftover_info.py +49 -0
- tooluniverse/tools/get_pymassspec_info.py +46 -0
- tooluniverse/tools/get_pymed_info.py +46 -0
- tooluniverse/tools/get_pymzml_info.py +46 -0
- tooluniverse/tools/get_pypdf2_info.py +46 -0
- tooluniverse/tools/get_pyranges_info.py +49 -0
- tooluniverse/tools/get_pyrosetta_info.py +44 -0
- tooluniverse/tools/get_pysam_info.py +46 -0
- tooluniverse/tools/get_pyscenic_info.py +46 -0
- tooluniverse/tools/get_pyscf_info.py +46 -0
- tooluniverse/tools/get_pyscreener_info.py +46 -0
- tooluniverse/tools/get_pytdc_info.py +46 -0
- tooluniverse/tools/get_python_libsbml_info.py +46 -0
- tooluniverse/tools/get_pytorch_info.py +49 -0
- tooluniverse/tools/get_pyvcf_info.py +44 -0
- tooluniverse/tools/get_pyvis_info.py +44 -0
- tooluniverse/tools/get_qutip_info.py +44 -0
- tooluniverse/tools/get_rasterio_info.py +44 -0
- tooluniverse/tools/get_rdkit_info.py +46 -0
- tooluniverse/tools/get_refinement_resolution_by_pdb_id.py +49 -0
- tooluniverse/tools/get_release_deposit_dates_by_pdb_id.py +49 -0
- tooluniverse/tools/get_reportlab_info.py +49 -0
- tooluniverse/tools/get_requests_info.py +49 -0
- tooluniverse/tools/get_ruptures_info.py +46 -0
- tooluniverse/tools/get_scanorama_info.py +44 -0
- tooluniverse/tools/get_scanpy_info.py +49 -0
- tooluniverse/tools/get_schnetpack_info.py +49 -0
- tooluniverse/tools/get_scholarly_info.py +46 -0
- tooluniverse/tools/get_scikit_bio_info.py +49 -0
- tooluniverse/tools/get_scikit_image_info.py +46 -0
- tooluniverse/tools/get_scikit_learn_info.py +49 -0
- tooluniverse/tools/get_scipy_info.py +46 -0
- tooluniverse/tools/get_scrublet_info.py +49 -0
- tooluniverse/tools/get_scvelo_info.py +49 -0
- tooluniverse/tools/get_scvi_tools_info.py +44 -0
- tooluniverse/tools/get_seaborn_info.py +49 -0
- tooluniverse/tools/get_sequence_by_pdb_id.py +46 -0
- tooluniverse/tools/get_sequence_lengths_by_pdb_id.py +46 -0
- tooluniverse/tools/get_sequence_positional_features_by_instance_id.py +49 -0
- tooluniverse/tools/get_skopt_info.py +44 -0
- tooluniverse/tools/get_souporcell_info.py +46 -0
- tooluniverse/tools/get_source_organism_by_pdb_id.py +46 -0
- tooluniverse/tools/get_space_group_by_pdb_id.py +46 -0
- tooluniverse/tools/get_statsmodels_info.py +49 -0
- tooluniverse/tools/get_structure_determination_software_by_pdb_id.py +49 -0
- tooluniverse/tools/get_structure_title_by_pdb_id.py +46 -0
- tooluniverse/tools/get_structure_validation_metrics_by_pdb_id.py +49 -0
- tooluniverse/tools/get_sunpy_info.py +44 -0
- tooluniverse/tools/get_sympy_info.py +46 -0
- tooluniverse/tools/get_target_cofactor_info.py +46 -0
- tooluniverse/tools/get_taxonomy_by_pdb_id.py +46 -0
- tooluniverse/tools/get_tiledb_info.py +46 -0
- tooluniverse/tools/get_tiledbsoma_info.py +46 -0
- tooluniverse/tools/get_torch_geometric_info.py +49 -0
- tooluniverse/tools/get_tqdm_info.py +46 -0
- tooluniverse/tools/get_trackpy_info.py +46 -0
- tooluniverse/tools/get_tskit_info.py +46 -0
- tooluniverse/tools/get_umap_learn_info.py +49 -0
- tooluniverse/tools/get_uniprot_accession_by_entity_id.py +49 -0
- tooluniverse/tools/get_velocyto_info.py +44 -0
- tooluniverse/tools/get_viennarna_info.py +49 -0
- tooluniverse/tools/get_webpage_text_from_url.py +52 -0
- tooluniverse/tools/get_webpage_title.py +49 -0
- tooluniverse/tools/get_xarray_info.py +44 -0
- tooluniverse/tools/get_xesmf_info.py +44 -0
- tooluniverse/tools/get_xgboost_info.py +44 -0
- tooluniverse/tools/get_zarr_info.py +44 -0
- tooluniverse/tools/gwas_get_association_by_id.py +49 -0
- tooluniverse/tools/gwas_get_associations_for_snp.py +67 -0
- tooluniverse/tools/gwas_get_associations_for_study.py +55 -0
- tooluniverse/tools/gwas_get_associations_for_trait.py +55 -0
- tooluniverse/tools/gwas_get_snp_by_id.py +46 -0
- tooluniverse/tools/gwas_get_snps_for_gene.py +55 -0
- tooluniverse/tools/gwas_get_studies_for_trait.py +75 -0
- tooluniverse/tools/gwas_get_study_by_id.py +46 -0
- tooluniverse/tools/gwas_get_variants_for_trait.py +55 -0
- tooluniverse/tools/gwas_search_associations.py +75 -0
- tooluniverse/tools/gwas_search_snps.py +63 -0
- tooluniverse/tools/gwas_search_studies.py +75 -0
- tooluniverse/tools/humanbase_ppi_analysis.py +67 -0
- tooluniverse/tools/mesh_get_subjects_by_pharmacological_action.py +63 -0
- tooluniverse/tools/mesh_get_subjects_by_subject_id.py +63 -0
- tooluniverse/tools/mesh_get_subjects_by_subject_name.py +63 -0
- tooluniverse/tools/mesh_get_subjects_by_subject_scope_or_definition.py +63 -0
- tooluniverse/tools/odphp_itemlist.py +49 -0
- tooluniverse/tools/odphp_myhealthfinder.py +67 -0
- tooluniverse/tools/odphp_outlink_fetch.py +59 -0
- tooluniverse/tools/odphp_topicsearch.py +67 -0
- tooluniverse/tools/openalex_literature_search.py +67 -0
- tooluniverse/tools/reactome_disease_target_score.py +52 -0
- tooluniverse/tools/search_clinical_trials.py +67 -0
- tooluniverse/tools/visualize_molecule_2d.py +83 -0
- tooluniverse/tools/visualize_molecule_3d.py +91 -0
- tooluniverse/tools/visualize_protein_structure_3d.py +79 -0
- tooluniverse/unified_guideline_tools.py +1210 -0
- tooluniverse/unpaywall_tool.py +62 -0
- tooluniverse/utils.py +71 -2
- tooluniverse/visualization_tool.py +897 -0
- tooluniverse/wikidata_sparql_tool.py +60 -0
- tooluniverse/zenodo_tool.py +72 -0
- {tooluniverse-1.0.5.dist-info → tooluniverse-1.0.7.dist-info}/METADATA +12 -2
- tooluniverse-1.0.7.dist-info/RECORD +855 -0
- {tooluniverse-1.0.5.dist-info → tooluniverse-1.0.7.dist-info}/entry_points.txt +4 -0
- tooluniverse/test/list_azure_openai_models.py +0 -210
- tooluniverse/test/mcp_server_test.py +0 -0
- tooluniverse/test/test_admetai_tool.py +0 -370
- tooluniverse/test/test_agentic_tool.py +0 -129
- tooluniverse/test/test_agentic_tool_azure_models.py +0 -91
- tooluniverse/test/test_alphafold_tool.py +0 -108
- tooluniverse/test/test_api_key_validation_min.py +0 -64
- tooluniverse/test/test_chem_tool.py +0 -37
- tooluniverse/test/test_claude_sdk.py +0 -86
- tooluniverse/test/test_compose_lieraturereview.py +0 -63
- tooluniverse/test/test_compose_tool.py +0 -448
- tooluniverse/test/test_dailymed.py +0 -69
- tooluniverse/test/test_dataset_tool.py +0 -200
- tooluniverse/test/test_disease_target_score.py +0 -56
- tooluniverse/test/test_drugbank_filter_examples.py +0 -179
- tooluniverse/test/test_efo.py +0 -31
- tooluniverse/test/test_enrichr_tool.py +0 -21
- tooluniverse/test/test_europe_pmc_tool.py +0 -20
- tooluniverse/test/test_fda_adv.py +0 -95
- tooluniverse/test/test_fda_drug_labeling.py +0 -91
- tooluniverse/test/test_gene_ontology_tools.py +0 -66
- tooluniverse/test/test_global_fallback.py +0 -288
- tooluniverse/test/test_gwas_tool.py +0 -139
- tooluniverse/test/test_hooks_direct.py +0 -219
- tooluniverse/test/test_hpa.py +0 -625
- tooluniverse/test/test_humanbase_tool.py +0 -20
- tooluniverse/test/test_idmap_tools.py +0 -61
- tooluniverse/test/test_list_built_in_tools.py +0 -33
- tooluniverse/test/test_mcp_server.py +0 -211
- tooluniverse/test/test_mcp_tool.py +0 -247
- tooluniverse/test/test_medlineplus.py +0 -220
- tooluniverse/test/test_odphp_tool.py +0 -166
- tooluniverse/test/test_openalex_tool.py +0 -32
- tooluniverse/test/test_openrouter_client.py +0 -288
- tooluniverse/test/test_opentargets.py +0 -28
- tooluniverse/test/test_pubchem_tool.py +0 -116
- tooluniverse/test/test_pubtator_tool.py +0 -37
- tooluniverse/test/test_rcsb_pdb_tool.py +0 -86
- tooluniverse/test/test_reactome.py +0 -54
- tooluniverse/test/test_semantic_scholar_tool.py +0 -24
- tooluniverse/test/test_software_tools.py +0 -147
- tooluniverse/test/test_stdio_hooks.py +0 -285
- tooluniverse/test/test_tool_description_optimizer.py +0 -49
- tooluniverse/test/test_tool_finder.py +0 -26
- tooluniverse/test/test_tool_finder_llm.py +0 -252
- tooluniverse/test/test_tools_find.py +0 -195
- tooluniverse/test/test_uniprot_tools.py +0 -74
- tooluniverse/test/test_uspto_tool.py +0 -72
- tooluniverse/test/test_xml_tool.py +0 -113
- tooluniverse-1.0.5.dist-info/RECORD +0 -198
- {tooluniverse-1.0.5.dist-info → tooluniverse-1.0.7.dist-info}/WHEEL +0 -0
- {tooluniverse-1.0.5.dist-info → tooluniverse-1.0.7.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-1.0.5.dist-info → tooluniverse-1.0.7.dist-info}/top_level.txt +0 -0
tooluniverse/smcp.py
CHANGED
|
@@ -92,6 +92,7 @@ AI Agent Interface:
|
|
|
92
92
|
"""
|
|
93
93
|
|
|
94
94
|
import asyncio
|
|
95
|
+
import functools
|
|
95
96
|
import json
|
|
96
97
|
from concurrent.futures import ThreadPoolExecutor
|
|
97
98
|
from typing import Any, Dict, List, Optional, Union, Callable, Literal
|
|
@@ -248,7 +249,7 @@ class SMCP(FastMCP):
|
|
|
248
249
|
or a list of both. Provides an easy way to enable hooks without full configuration.
|
|
249
250
|
Takes precedence over hooks_enabled when specified.
|
|
250
251
|
|
|
251
|
-
**kwargs
|
|
252
|
+
**kwargs**
|
|
252
253
|
Additional arguments passed to the underlying FastMCP server instance.
|
|
253
254
|
Supports all FastMCP configuration options for advanced customization.
|
|
254
255
|
|
|
@@ -348,9 +349,9 @@ class SMCP(FastMCP):
|
|
|
348
349
|
Register custom MCP protocol methods for enhanced functionality.
|
|
349
350
|
|
|
350
351
|
This method extends the standard MCP protocol by registering custom handlers
|
|
351
|
-
for scientific tool discovery and search operations. It
|
|
352
|
-
|
|
353
|
-
|
|
352
|
+
for scientific tool discovery and search operations. It uses FastMCP's
|
|
353
|
+
middleware system to handle custom methods while maintaining compatibility
|
|
354
|
+
with standard MCP operations.
|
|
354
355
|
|
|
355
356
|
Custom Methods Registered:
|
|
356
357
|
=========================
|
|
@@ -359,38 +360,20 @@ class SMCP(FastMCP):
|
|
|
359
360
|
|
|
360
361
|
Implementation Details:
|
|
361
362
|
======================
|
|
362
|
-
-
|
|
363
|
-
-
|
|
364
|
-
-
|
|
363
|
+
- Uses FastMCP's middleware system instead of request handler patching
|
|
364
|
+
- Implements custom middleware methods for tools/find and tools/search
|
|
365
|
+
- Standard MCP methods (tools/list, tools/call) are handled by FastMCP
|
|
365
366
|
- Implements proper error handling and JSON-RPC 2.0 compliance
|
|
366
367
|
|
|
367
|
-
Error Handling:
|
|
368
|
-
==============
|
|
369
|
-
- Gracefully handles missing request handlers
|
|
370
|
-
- Logs warnings for debugging when handler patching fails
|
|
371
|
-
- Ensures server continues to function even if custom methods fail to register
|
|
372
|
-
|
|
373
368
|
Notes:
|
|
374
369
|
======
|
|
375
370
|
This method is called automatically during SMCP initialization and should
|
|
376
|
-
not be called manually.
|
|
371
|
+
not be called manually.
|
|
377
372
|
"""
|
|
378
373
|
try:
|
|
379
|
-
#
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
# Store original handler
|
|
384
|
-
self._original_handle_request = getattr(self, "_handle_request", None)
|
|
385
|
-
|
|
386
|
-
# Replace with custom handler
|
|
387
|
-
if hasattr(self, "_handle_request"):
|
|
388
|
-
self._handle_request = self._custom_handle_request
|
|
389
|
-
elif hasattr(self, "handle_request"):
|
|
390
|
-
self._original_handle_request = self.handle_request
|
|
391
|
-
self.handle_request = self._custom_handle_request
|
|
392
|
-
else:
|
|
393
|
-
self.logger.warning("Could not find request handler to override")
|
|
374
|
+
# Add custom middleware for tools/find and tools/search
|
|
375
|
+
self.add_middleware(self._tools_find_middleware)
|
|
376
|
+
self.logger.info("✅ Custom MCP methods registered successfully")
|
|
394
377
|
|
|
395
378
|
except Exception as e:
|
|
396
379
|
self.logger.error(f"Error registering custom MCP methods: {e}")
|
|
@@ -414,117 +397,32 @@ class SMCP(FastMCP):
|
|
|
414
397
|
self.logger.error(f"❌ Error getting valid categories: {e}")
|
|
415
398
|
return set()
|
|
416
399
|
|
|
417
|
-
async def
|
|
400
|
+
async def _tools_find_middleware(self, context, call_next):
|
|
418
401
|
"""
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
This handler intercepts MCP requests and provides specialized handling for
|
|
422
|
-
scientific tool discovery methods while maintaining full compatibility with
|
|
423
|
-
standard MCP protocol operations.
|
|
424
|
-
|
|
425
|
-
Parameters:
|
|
426
|
-
===========
|
|
427
|
-
request : dict
|
|
428
|
-
JSON-RPC 2.0 request object containing:
|
|
429
|
-
- method: The MCP method being called
|
|
430
|
-
- id: Request identifier for response correlation
|
|
431
|
-
- params: Method-specific parameters
|
|
432
|
-
|
|
433
|
-
Returns:
|
|
434
|
-
========
|
|
435
|
-
dict
|
|
436
|
-
JSON-RPC 2.0 response object with either:
|
|
437
|
-
- result: Successful operation result
|
|
438
|
-
- error: Error information with code and message
|
|
439
|
-
|
|
440
|
-
Supported Custom Methods:
|
|
441
|
-
========================
|
|
442
|
-
tools/find:
|
|
443
|
-
Search for tools using natural language queries with AI-powered recommendations.
|
|
444
|
-
Parameters:
|
|
445
|
-
- query (required): Natural language description of desired functionality
|
|
446
|
-
- categories (optional): List of tool categories to filter by
|
|
447
|
-
- limit (optional): Maximum number of results (default: 10)
|
|
448
|
-
- use_advanced_search (optional): Use AI vs keyword search (default: True)
|
|
449
|
-
- search_method (optional): Specific search method - 'auto', 'llm', 'embedding', 'keyword' (default: 'auto')
|
|
450
|
-
- format (optional): Response format - 'detailed' or 'mcp_standard'
|
|
451
|
-
|
|
452
|
-
tools/search:
|
|
453
|
-
Alias for tools/find method with identical parameters and behavior.
|
|
454
|
-
|
|
455
|
-
Standard MCP Methods:
|
|
456
|
-
All other methods are forwarded to the original FastMCP handler,
|
|
457
|
-
ensuring full compatibility with MCP specification.
|
|
458
|
-
|
|
459
|
-
Error Codes:
|
|
460
|
-
============
|
|
461
|
-
- -32601: Method not found (unknown method)
|
|
462
|
-
- -32602: Invalid params (missing required parameters)
|
|
463
|
-
- -32603: Internal error (server-side failures)
|
|
464
|
-
|
|
465
|
-
Examples:
|
|
466
|
-
=========
|
|
467
|
-
Request for tool discovery:
|
|
468
|
-
```json
|
|
469
|
-
{
|
|
470
|
-
"jsonrpc": "2.0",
|
|
471
|
-
"id": "search_123",
|
|
472
|
-
"method": "tools/find",
|
|
473
|
-
"params": {
|
|
474
|
-
"query": "protein structure analysis",
|
|
475
|
-
"limit": 5,
|
|
476
|
-
"format": "mcp_standard"
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
```
|
|
402
|
+
Middleware for handling tools/find and tools/search requests.
|
|
480
403
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
{
|
|
484
|
-
"jsonrpc": "2.0",
|
|
485
|
-
"id": "search_123",
|
|
486
|
-
"result": {
|
|
487
|
-
"tools": [...],
|
|
488
|
-
"_meta": {
|
|
489
|
-
"search_query": "protein structure analysis",
|
|
490
|
-
"search_method": "AI-powered (ToolFinderLLM)",
|
|
491
|
-
"total_matches": 5
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
```
|
|
404
|
+
This middleware intercepts tools/find and tools/search requests and
|
|
405
|
+
provides AI-powered tool discovery functionality.
|
|
496
406
|
"""
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
# For all other methods, use the original handler
|
|
509
|
-
if self._original_handle_request:
|
|
510
|
-
if asyncio.iscoroutinefunction(self._original_handle_request):
|
|
511
|
-
return await self._original_handle_request(request)
|
|
512
|
-
else:
|
|
513
|
-
return self._original_handle_request(request)
|
|
514
|
-
else:
|
|
515
|
-
# Fallback: return method not found error
|
|
407
|
+
# Check if this is a tools/find or tools/search request
|
|
408
|
+
if hasattr(context, "method") and context.method in [
|
|
409
|
+
"tools/find",
|
|
410
|
+
"tools/search",
|
|
411
|
+
]:
|
|
412
|
+
try:
|
|
413
|
+
# Handle the custom method
|
|
414
|
+
result = await self._handle_tools_find(context.id, context.params)
|
|
415
|
+
return result
|
|
416
|
+
except Exception as e:
|
|
417
|
+
self.logger.error(f"Error in tools/find middleware: {e}")
|
|
516
418
|
return {
|
|
517
419
|
"jsonrpc": "2.0",
|
|
518
|
-
"id":
|
|
519
|
-
"error": {"code": -
|
|
420
|
+
"id": context.id,
|
|
421
|
+
"error": {"code": -32603, "message": f"Internal error: {str(e)}"},
|
|
520
422
|
}
|
|
521
423
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
"jsonrpc": "2.0",
|
|
525
|
-
"id": request.get("id"),
|
|
526
|
-
"error": {"code": -32603, "message": f"Internal error: {str(e)}"},
|
|
527
|
-
}
|
|
424
|
+
# For all other methods, call the next middleware/handler
|
|
425
|
+
return await call_next(context)
|
|
528
426
|
|
|
529
427
|
async def _handle_tools_find(
|
|
530
428
|
self, request_id: str, params: Dict[str, Any]
|
|
@@ -644,11 +542,40 @@ class SMCP(FastMCP):
|
|
|
644
542
|
# Parse the search result
|
|
645
543
|
search_data = json.loads(search_result)
|
|
646
544
|
|
|
545
|
+
# Handle different response formats
|
|
546
|
+
if isinstance(search_data, list):
|
|
547
|
+
# If search_data is a list, treat it as tools directly
|
|
548
|
+
tools_list = search_data
|
|
549
|
+
search_metadata = {
|
|
550
|
+
"search_query": query,
|
|
551
|
+
"search_method": "unknown",
|
|
552
|
+
"total_matches": len(tools_list),
|
|
553
|
+
"categories_filtered": categories,
|
|
554
|
+
}
|
|
555
|
+
elif isinstance(search_data, dict):
|
|
556
|
+
# If search_data is a dict, extract tools and metadata
|
|
557
|
+
tools_list = search_data.get("tools", [])
|
|
558
|
+
search_metadata = {
|
|
559
|
+
"search_query": query,
|
|
560
|
+
"search_method": search_data.get("search_method", "unknown"),
|
|
561
|
+
"total_matches": search_data.get("total_matches", len(tools_list)),
|
|
562
|
+
"categories_filtered": categories,
|
|
563
|
+
}
|
|
564
|
+
else:
|
|
565
|
+
# Fallback for unexpected format
|
|
566
|
+
tools_list = []
|
|
567
|
+
search_metadata = {
|
|
568
|
+
"search_query": query,
|
|
569
|
+
"search_method": "unknown",
|
|
570
|
+
"total_matches": 0,
|
|
571
|
+
"categories_filtered": categories,
|
|
572
|
+
}
|
|
573
|
+
|
|
647
574
|
# Format response based on requested format
|
|
648
575
|
if format_type == "mcp_standard":
|
|
649
576
|
# Format as standard MCP tools/list style response
|
|
650
|
-
|
|
651
|
-
for tool in
|
|
577
|
+
mcp_tools_list = []
|
|
578
|
+
for tool in tools_list:
|
|
652
579
|
mcp_tool = {
|
|
653
580
|
"name": tool.get("name"),
|
|
654
581
|
"description": tool.get("description", ""),
|
|
@@ -658,16 +585,11 @@ class SMCP(FastMCP):
|
|
|
658
585
|
"required": tool.get("required", []),
|
|
659
586
|
},
|
|
660
587
|
}
|
|
661
|
-
|
|
588
|
+
mcp_tools_list.append(mcp_tool)
|
|
662
589
|
|
|
663
590
|
result = {
|
|
664
|
-
"tools":
|
|
665
|
-
"_meta":
|
|
666
|
-
"search_query": query,
|
|
667
|
-
"search_method": search_data.get("search_method"),
|
|
668
|
-
"total_matches": search_data.get("total_matches"),
|
|
669
|
-
"categories_filtered": categories,
|
|
670
|
-
},
|
|
591
|
+
"tools": mcp_tools_list,
|
|
592
|
+
"_meta": search_metadata,
|
|
671
593
|
}
|
|
672
594
|
else:
|
|
673
595
|
# Return detailed format (default)
|
|
@@ -1388,9 +1310,7 @@ class SMCP(FastMCP):
|
|
|
1388
1310
|
if "Tool_Finder_LLM" in available_tool_names:
|
|
1389
1311
|
self.tool_finder_available = True
|
|
1390
1312
|
self.tool_finder_type = "Tool_Finder_LLM"
|
|
1391
|
-
self.logger.info(
|
|
1392
|
-
"✅ Tool_Finder_LLM available for advanced search"
|
|
1393
|
-
)
|
|
1313
|
+
self.logger.info("✅ Tool_Finder_LLM available for advanced search")
|
|
1394
1314
|
return
|
|
1395
1315
|
|
|
1396
1316
|
# Fallback to Tool_RAG (embedding-based)
|
|
@@ -1696,7 +1616,7 @@ class SMCP(FastMCP):
|
|
|
1696
1616
|
this will be set as the function's __doc__ attribute. If None, the
|
|
1697
1617
|
function's existing docstring will be used.
|
|
1698
1618
|
|
|
1699
|
-
**kwargs
|
|
1619
|
+
**kwargs**
|
|
1700
1620
|
Additional FastMCP tool configuration options:
|
|
1701
1621
|
- parameter_schema: Custom JSON schema for parameters
|
|
1702
1622
|
- return_schema: Schema for return values
|
|
@@ -1772,7 +1692,7 @@ class SMCP(FastMCP):
|
|
|
1772
1692
|
- Support all MCP client interaction patterns
|
|
1773
1693
|
|
|
1774
1694
|
Best Practices:
|
|
1775
|
-
|
|
1695
|
+
===============
|
|
1776
1696
|
- Use descriptive, unique tool names
|
|
1777
1697
|
- Include comprehensive docstrings
|
|
1778
1698
|
- Add proper type annotations for parameters
|
|
@@ -1803,7 +1723,7 @@ class SMCP(FastMCP):
|
|
|
1803
1723
|
It's designed to be safe to call multiple times and handles errors gracefully.
|
|
1804
1724
|
|
|
1805
1725
|
Cleanup Operations:
|
|
1806
|
-
|
|
1726
|
+
===================
|
|
1807
1727
|
|
|
1808
1728
|
**Thread Pool Shutdown:**
|
|
1809
1729
|
- Gracefully stops the ThreadPoolExecutor used for tool execution
|
|
@@ -1823,7 +1743,7 @@ class SMCP(FastMCP):
|
|
|
1823
1743
|
- Ensures critical resources are always released
|
|
1824
1744
|
|
|
1825
1745
|
Usage Patterns:
|
|
1826
|
-
|
|
1746
|
+
===============
|
|
1827
1747
|
|
|
1828
1748
|
**Automatic Cleanup (Recommended):**
|
|
1829
1749
|
```python
|
|
@@ -1853,14 +1773,14 @@ class SMCP(FastMCP):
|
|
|
1853
1773
|
```
|
|
1854
1774
|
|
|
1855
1775
|
Performance Considerations:
|
|
1856
|
-
|
|
1776
|
+
===========================
|
|
1857
1777
|
- Cleanup operations are typically fast (< 1 second)
|
|
1858
1778
|
- Thread pool shutdown may take longer if tasks are running
|
|
1859
1779
|
- Network connections are closed immediately
|
|
1860
1780
|
- Memory cleanup depends on garbage collection
|
|
1861
1781
|
|
|
1862
1782
|
Error Recovery:
|
|
1863
|
-
|
|
1783
|
+
===============
|
|
1864
1784
|
- Individual cleanup failures don't stop the overall process
|
|
1865
1785
|
- Critical errors are logged but don't raise exceptions
|
|
1866
1786
|
- Cleanup is idempotent - safe to call multiple times
|
|
@@ -1882,30 +1802,30 @@ class SMCP(FastMCP):
|
|
|
1882
1802
|
def _print_tooluniverse_banner(self):
|
|
1883
1803
|
"""Print ToolUniverse branding banner after FastMCP banner with dynamic information."""
|
|
1884
1804
|
# Get transport info if available
|
|
1885
|
-
transport_display = getattr(self,
|
|
1886
|
-
server_url = getattr(self,
|
|
1805
|
+
transport_display = getattr(self, "_transport_type", "Unknown")
|
|
1806
|
+
server_url = getattr(self, "_server_url", "N/A")
|
|
1887
1807
|
tools_count = len(self._exposed_tools)
|
|
1888
|
-
|
|
1808
|
+
|
|
1889
1809
|
# Map transport types to display names
|
|
1890
1810
|
transport_map = {
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1811
|
+
"stdio": "STDIO",
|
|
1812
|
+
"streamable-http": "Streamable-HTTP",
|
|
1813
|
+
"http": "HTTP",
|
|
1814
|
+
"sse": "SSE",
|
|
1895
1815
|
}
|
|
1896
1816
|
transport_name = transport_map.get(transport_display, transport_display)
|
|
1897
|
-
|
|
1817
|
+
|
|
1898
1818
|
# Format lines with proper alignment (matching FastMCP style)
|
|
1899
1819
|
# Each line should be exactly 75 characters (emoji takes 2 display widths but counts as 1 in len())
|
|
1900
1820
|
transport_line = f" 📦 Transport: {transport_name}"
|
|
1901
1821
|
server_line = f" 🔗 Server URL: {server_url}"
|
|
1902
1822
|
tools_line = f" 🧰 Loaded Tools: {tools_count}"
|
|
1903
|
-
|
|
1823
|
+
|
|
1904
1824
|
# Pad to exactly 75 characters (emoji counts as 1 in len() but displays as 2)
|
|
1905
1825
|
transport_line = transport_line + " " * (75 - len(transport_line))
|
|
1906
1826
|
server_line = server_line + " " * (75 - len(server_line))
|
|
1907
1827
|
tools_line = tools_line + " " * (75 - len(tools_line))
|
|
1908
|
-
|
|
1828
|
+
|
|
1909
1829
|
banner = f"""
|
|
1910
1830
|
╭────────────────────────────────────────────────────────────────────────────╮
|
|
1911
1831
|
│ │
|
|
@@ -1927,40 +1847,40 @@ class SMCP(FastMCP):
|
|
|
1927
1847
|
def run(self, *args, **kwargs):
|
|
1928
1848
|
"""
|
|
1929
1849
|
Override run method to display ToolUniverse banner after FastMCP banner.
|
|
1930
|
-
|
|
1850
|
+
|
|
1931
1851
|
This method intercepts the parent's run() call to inject our custom banner
|
|
1932
1852
|
immediately after FastMCP displays its startup banner.
|
|
1933
1853
|
"""
|
|
1934
1854
|
# Save transport information for banner display
|
|
1935
|
-
transport = kwargs.get(
|
|
1936
|
-
host = kwargs.get(
|
|
1937
|
-
port = kwargs.get(
|
|
1938
|
-
|
|
1855
|
+
transport = kwargs.get("transport", args[0] if args else "unknown")
|
|
1856
|
+
host = kwargs.get("host", "0.0.0.0")
|
|
1857
|
+
port = kwargs.get("port", 7000)
|
|
1858
|
+
|
|
1939
1859
|
self._transport_type = transport
|
|
1940
|
-
|
|
1860
|
+
|
|
1941
1861
|
# Build server URL based on transport
|
|
1942
|
-
if transport ==
|
|
1862
|
+
if transport == "streamable-http" or transport == "http":
|
|
1943
1863
|
self._server_url = f"http://{host}:{port}/mcp"
|
|
1944
|
-
elif transport ==
|
|
1864
|
+
elif transport == "sse":
|
|
1945
1865
|
self._server_url = f"http://{host}:{port}"
|
|
1946
1866
|
else:
|
|
1947
1867
|
self._server_url = "N/A (stdio mode)"
|
|
1948
|
-
|
|
1868
|
+
|
|
1949
1869
|
# Use threading to print our banner shortly after FastMCP's banner
|
|
1950
1870
|
import threading
|
|
1951
1871
|
import time
|
|
1952
|
-
|
|
1872
|
+
|
|
1953
1873
|
def delayed_banner():
|
|
1954
1874
|
"""Print ToolUniverse banner with a small delay to appear after FastMCP banner."""
|
|
1955
1875
|
time.sleep(1.0) # Delay to ensure FastMCP banner displays first
|
|
1956
1876
|
self._print_tooluniverse_banner()
|
|
1957
|
-
|
|
1877
|
+
|
|
1958
1878
|
# Start banner thread only on first run
|
|
1959
|
-
if not hasattr(self,
|
|
1879
|
+
if not hasattr(self, "_tooluniverse_banner_shown"):
|
|
1960
1880
|
self._tooluniverse_banner_shown = True
|
|
1961
1881
|
banner_thread = threading.Thread(target=delayed_banner, daemon=True)
|
|
1962
1882
|
banner_thread.start()
|
|
1963
|
-
|
|
1883
|
+
|
|
1964
1884
|
# Call parent's run method (blocking call)
|
|
1965
1885
|
return super().run(*args, **kwargs)
|
|
1966
1886
|
|
|
@@ -2010,21 +1930,21 @@ class SMCP(FastMCP):
|
|
|
2010
1930
|
- Above 1024: No root privileges required
|
|
2011
1931
|
- Check availability: Ensure port isn't already in use
|
|
2012
1932
|
|
|
2013
|
-
**kwargs
|
|
1933
|
+
**kwargs**
|
|
2014
1934
|
Additional arguments passed to FastMCP's run() method:
|
|
2015
1935
|
- debug (bool): Enable debug logging
|
|
2016
1936
|
- access_log (bool): Log client requests
|
|
2017
1937
|
- workers (int): Number of worker processes (HTTP only)
|
|
2018
1938
|
|
|
2019
1939
|
Server Startup Process:
|
|
2020
|
-
|
|
1940
|
+
=======================
|
|
2021
1941
|
1. **Initialization Summary**: Displays server configuration and capabilities
|
|
2022
1942
|
2. **Transport Setup**: Configures selected communication method
|
|
2023
1943
|
3. **Service Start**: Begins listening for client connections
|
|
2024
1944
|
4. **Graceful Shutdown**: Handles interrupts and cleanup
|
|
2025
1945
|
|
|
2026
1946
|
Deployment Scenarios:
|
|
2027
|
-
|
|
1947
|
+
=====================
|
|
2028
1948
|
|
|
2029
1949
|
Development & Testing:
|
|
2030
1950
|
```python
|
|
@@ -2060,14 +1980,14 @@ class SMCP(FastMCP):
|
|
|
2060
1980
|
```
|
|
2061
1981
|
|
|
2062
1982
|
Error Handling:
|
|
2063
|
-
|
|
1983
|
+
===============
|
|
2064
1984
|
- **KeyboardInterrupt**: Graceful shutdown on Ctrl+C
|
|
2065
1985
|
- **Port in Use**: Clear error message with suggestions
|
|
2066
1986
|
- **Transport Errors**: Detailed debugging information
|
|
2067
1987
|
- **Cleanup**: Automatic resource cleanup on exit
|
|
2068
1988
|
|
|
2069
1989
|
Logging Output:
|
|
2070
|
-
|
|
1990
|
+
===============
|
|
2071
1991
|
Provides informative startup messages:
|
|
2072
1992
|
```
|
|
2073
1993
|
🚀 Starting SMCP server 'My Server'...
|
|
@@ -2077,14 +1997,14 @@ class SMCP(FastMCP):
|
|
|
2077
1997
|
```
|
|
2078
1998
|
|
|
2079
1999
|
Security Considerations:
|
|
2080
|
-
|
|
2000
|
+
========================
|
|
2081
2001
|
- Use host="127.0.0.1" for local-only access
|
|
2082
2002
|
- Configure firewall rules for production deployment
|
|
2083
2003
|
- Consider HTTPS termination with reverse proxy
|
|
2084
2004
|
- Validate all client inputs through MCP protocol
|
|
2085
2005
|
|
|
2086
2006
|
Performance Notes:
|
|
2087
|
-
|
|
2007
|
+
==================
|
|
2088
2008
|
- HTTP transport supports multiple concurrent clients
|
|
2089
2009
|
- stdio transport is single-client but lower latency
|
|
2090
2010
|
- SSE transport enables real-time bidirectional communication
|
|
@@ -2108,6 +2028,29 @@ class SMCP(FastMCP):
|
|
|
2108
2028
|
else:
|
|
2109
2029
|
self.logger.info("🔗 Hooks disabled")
|
|
2110
2030
|
|
|
2031
|
+
# Configure logger for stdio mode to avoid stdout pollution
|
|
2032
|
+
if transport == "stdio":
|
|
2033
|
+
import logging
|
|
2034
|
+
import sys
|
|
2035
|
+
|
|
2036
|
+
# Redirect all logger output to stderr for stdio mode
|
|
2037
|
+
for handler in self.logger.handlers[:]:
|
|
2038
|
+
self.logger.removeHandler(handler)
|
|
2039
|
+
|
|
2040
|
+
stderr_handler = logging.StreamHandler(sys.stderr)
|
|
2041
|
+
stderr_handler.setLevel(logging.INFO)
|
|
2042
|
+
formatter = logging.Formatter("%(message)s")
|
|
2043
|
+
stderr_handler.setFormatter(formatter)
|
|
2044
|
+
self.logger.addHandler(stderr_handler)
|
|
2045
|
+
self.logger.setLevel(logging.INFO)
|
|
2046
|
+
|
|
2047
|
+
# Also redirect root logger to stderr
|
|
2048
|
+
root_logger = logging.getLogger()
|
|
2049
|
+
for handler in root_logger.handlers[:]:
|
|
2050
|
+
root_logger.removeHandler(handler)
|
|
2051
|
+
root_logger.addHandler(stderr_handler)
|
|
2052
|
+
root_logger.setLevel(logging.INFO)
|
|
2053
|
+
|
|
2111
2054
|
try:
|
|
2112
2055
|
if transport == "stdio":
|
|
2113
2056
|
self.run(transport="stdio", **kwargs)
|
|
@@ -2243,7 +2186,10 @@ class SMCP(FastMCP):
|
|
|
2243
2186
|
cleaned_props[prop_name] = cleaned_prop
|
|
2244
2187
|
|
|
2245
2188
|
# Create proper JSON schema for nested object
|
|
2246
|
-
object_schema = {
|
|
2189
|
+
object_schema = {
|
|
2190
|
+
"type": "object",
|
|
2191
|
+
"properties": cleaned_props,
|
|
2192
|
+
}
|
|
2247
2193
|
|
|
2248
2194
|
# Add required array at object level if there are required fields
|
|
2249
2195
|
if nested_required:
|
|
@@ -2292,93 +2238,108 @@ class SMCP(FastMCP):
|
|
|
2292
2238
|
)
|
|
2293
2239
|
)
|
|
2294
2240
|
|
|
2295
|
-
#
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
function_call,
|
|
2310
|
-
)
|
|
2311
|
-
|
|
2312
|
-
# Format the result
|
|
2313
|
-
if isinstance(result, str):
|
|
2314
|
-
return result
|
|
2315
|
-
else:
|
|
2316
|
-
return json.dumps(result, indent=2, default=str)
|
|
2317
|
-
|
|
2318
|
-
except Exception as e:
|
|
2319
|
-
error_msg = f"Error executing {tool_name}: {str(e)}"
|
|
2320
|
-
self.logger.error(error_msg)
|
|
2321
|
-
return json.dumps({"error": error_msg}, indent=2)
|
|
2322
|
-
|
|
2323
|
-
# Set function metadata
|
|
2324
|
-
dynamic_tool_function.__name__ = tool_name
|
|
2325
|
-
dynamic_tool_function.__signature__ = inspect.Signature([])
|
|
2326
|
-
dynamic_tool_function.__annotations__ = {"return": str}
|
|
2327
|
-
|
|
2328
|
-
else:
|
|
2329
|
-
# Tool has parameters - create function with dynamic signature
|
|
2330
|
-
async def dynamic_tool_function(**kwargs) -> str:
|
|
2331
|
-
"""Execute ToolUniverse tool with provided arguments."""
|
|
2332
|
-
try:
|
|
2333
|
-
# Filter out None values for optional parameters
|
|
2334
|
-
args_dict = {k: v for k, v in kwargs.items() if v is not None}
|
|
2335
|
-
|
|
2336
|
-
# Validate required parameters
|
|
2337
|
-
missing_required = [
|
|
2338
|
-
param for param in required_params if param not in args_dict
|
|
2339
|
-
]
|
|
2340
|
-
if missing_required:
|
|
2341
|
-
return json.dumps(
|
|
2342
|
-
{
|
|
2343
|
-
"error": f"Missing required parameters: {missing_required}",
|
|
2344
|
-
"required": required_params,
|
|
2345
|
-
"provided": list(args_dict.keys()),
|
|
2346
|
-
},
|
|
2347
|
-
indent=2,
|
|
2348
|
-
)
|
|
2241
|
+
# Add optional streaming parameter to signature
|
|
2242
|
+
stream_field = Field(
|
|
2243
|
+
description="Set to true to receive incremental streaming output (experimental)."
|
|
2244
|
+
)
|
|
2245
|
+
stream_annotation = Annotated[Union[bool, type(None)], stream_field]
|
|
2246
|
+
param_annotations["_tooluniverse_stream"] = stream_annotation
|
|
2247
|
+
func_params.append(
|
|
2248
|
+
inspect.Parameter(
|
|
2249
|
+
"_tooluniverse_stream",
|
|
2250
|
+
inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
|
2251
|
+
default=None,
|
|
2252
|
+
annotation=stream_annotation,
|
|
2253
|
+
)
|
|
2254
|
+
)
|
|
2349
2255
|
|
|
2350
|
-
|
|
2351
|
-
|
|
2256
|
+
# Note: ctx parameter removed as it causes Pydantic schema issues
|
|
2257
|
+
# FastMCP context injection is handled internally by FastMCP
|
|
2258
|
+
|
|
2259
|
+
async def dynamic_tool_function(**kwargs) -> str:
|
|
2260
|
+
"""Execute ToolUniverse tool with provided arguments."""
|
|
2261
|
+
try:
|
|
2262
|
+
# Remove ctx if present (legacy support)
|
|
2263
|
+
ctx = kwargs.pop("ctx", None) if "ctx" in kwargs else None
|
|
2264
|
+
stream_flag = bool(kwargs.get("_tooluniverse_stream"))
|
|
2265
|
+
|
|
2266
|
+
# Filter out None values for optional parameters (preserve streaming flag)
|
|
2267
|
+
args_dict = {k: v for k, v in kwargs.items() if v is not None}
|
|
2268
|
+
filtered_args = {
|
|
2269
|
+
k: v
|
|
2270
|
+
for k, v in args_dict.items()
|
|
2271
|
+
if k != "_tooluniverse_stream"
|
|
2272
|
+
}
|
|
2352
2273
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2274
|
+
# Validate required parameters
|
|
2275
|
+
missing_required = [
|
|
2276
|
+
param for param in required_params if param not in filtered_args
|
|
2277
|
+
]
|
|
2278
|
+
if missing_required:
|
|
2279
|
+
return json.dumps(
|
|
2280
|
+
{
|
|
2281
|
+
"error": f"Missing required parameters: {missing_required}",
|
|
2282
|
+
"required": required_params,
|
|
2283
|
+
"provided": list(filtered_args.keys()),
|
|
2284
|
+
},
|
|
2285
|
+
indent=2,
|
|
2359
2286
|
)
|
|
2360
2287
|
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2288
|
+
function_call = {"name": tool_name, "arguments": args_dict}
|
|
2289
|
+
|
|
2290
|
+
loop = asyncio.get_event_loop()
|
|
2291
|
+
|
|
2292
|
+
if stream_flag and ctx is not None:
|
|
2293
|
+
|
|
2294
|
+
def stream_callback(chunk: str) -> None:
|
|
2295
|
+
if not chunk:
|
|
2296
|
+
return
|
|
2297
|
+
try:
|
|
2298
|
+
future = asyncio.run_coroutine_threadsafe(
|
|
2299
|
+
ctx.info(chunk), loop
|
|
2300
|
+
)
|
|
2301
|
+
|
|
2302
|
+
def _log_future_result(fut) -> None:
|
|
2303
|
+
exc = fut.exception()
|
|
2304
|
+
if exc:
|
|
2305
|
+
self.logger.debug(
|
|
2306
|
+
f"Streaming callback error for {tool_name}: {exc}"
|
|
2307
|
+
)
|
|
2308
|
+
|
|
2309
|
+
future.add_done_callback(_log_future_result)
|
|
2310
|
+
except Exception as cb_error: # noqa: BLE001
|
|
2311
|
+
self.logger.debug(
|
|
2312
|
+
f"Failed to dispatch stream chunk for {tool_name}: {cb_error}"
|
|
2313
|
+
)
|
|
2314
|
+
|
|
2315
|
+
# Ensure downstream tools see the streaming flag
|
|
2316
|
+
if "_tooluniverse_stream" not in args_dict:
|
|
2317
|
+
args_dict["_tooluniverse_stream"] = True
|
|
2318
|
+
|
|
2319
|
+
run_callable = functools.partial(
|
|
2320
|
+
self.tooluniverse.run_one_function,
|
|
2321
|
+
function_call,
|
|
2322
|
+
stream_callback=stream_callback,
|
|
2323
|
+
)
|
|
2366
2324
|
|
|
2367
|
-
|
|
2368
|
-
error_msg = f"Error executing {tool_name}: {str(e)}"
|
|
2369
|
-
self.logger.error(error_msg)
|
|
2370
|
-
return json.dumps({"error": error_msg}, indent=2)
|
|
2325
|
+
result = await loop.run_in_executor(self.executor, run_callable)
|
|
2371
2326
|
|
|
2372
|
-
|
|
2373
|
-
|
|
2327
|
+
if isinstance(result, str):
|
|
2328
|
+
return result
|
|
2329
|
+
else:
|
|
2330
|
+
return json.dumps(result, indent=2, default=str)
|
|
2374
2331
|
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2332
|
+
except Exception as e:
|
|
2333
|
+
error_msg = f"Error executing {tool_name}: {str(e)}"
|
|
2334
|
+
self.logger.error(error_msg)
|
|
2335
|
+
return json.dumps({"error": error_msg}, indent=2)
|
|
2378
2336
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2337
|
+
# Set function metadata
|
|
2338
|
+
dynamic_tool_function.__name__ = tool_name
|
|
2339
|
+
dynamic_tool_function.__signature__ = inspect.Signature(func_params)
|
|
2340
|
+
annotations = param_annotations.copy()
|
|
2341
|
+
annotations["return"] = str
|
|
2342
|
+
dynamic_tool_function.__annotations__ = annotations
|
|
2382
2343
|
|
|
2383
2344
|
# Create detailed docstring for internal use, but use clean description for FastMCP
|
|
2384
2345
|
param_docs = []
|
|
@@ -2403,6 +2364,10 @@ Returns:
|
|
|
2403
2364
|
|
|
2404
2365
|
except Exception as e:
|
|
2405
2366
|
self.logger.error(f"Error creating MCP tool from config: {e}")
|
|
2367
|
+
self.logger.error(f"Error type: {type(e)}")
|
|
2368
|
+
import traceback
|
|
2369
|
+
|
|
2370
|
+
self.logger.error(f"Traceback: {traceback.format_exc()}")
|
|
2406
2371
|
self.logger.debug(f"Tool config: {tool_config}")
|
|
2407
2372
|
# Don't raise - continue with other tools
|
|
2408
2373
|
return
|
|
@@ -2452,7 +2417,7 @@ def create_smcp_server(
|
|
|
2452
2417
|
Recommended to keep enabled unless you have specific performance
|
|
2453
2418
|
requirements or want to minimize dependencies.
|
|
2454
2419
|
|
|
2455
|
-
**kwargs
|
|
2420
|
+
**kwargs**
|
|
2456
2421
|
Additional SMCP configuration options:
|
|
2457
2422
|
|
|
2458
2423
|
- tooluniverse_config: Pre-configured ToolUniverse instance
|