tooluniverse.compose_scripts package

Submodules

tooluniverse.compose_scripts.biomarker_discovery module

Biomarker Discovery Workflow Discover and validate biomarkers for a specific disease condition using compose tools

tooluniverse.compose_scripts.biomarker_discovery.compose(arguments, tooluniverse, call_tool)[source]

Discover and validate biomarkers for a specific disease condition

tooluniverse.compose_scripts.comprehensive_drug_discovery module

Comprehensive Drug Discovery Pipeline Complete end-to-end drug discovery workflow from disease to optimized candidates

tooluniverse.compose_scripts.comprehensive_drug_discovery.compose(arguments, tooluniverse, call_tool)[source]

End-to-end drug discovery: Target → Lead → Optimization → Validation

tooluniverse.compose_scripts.drug_safety_analyzer module

Drug Safety Analysis Pipeline Comprehensive drug safety analysis combining adverse event data, literature review, and molecular information

tooluniverse.compose_scripts.drug_safety_analyzer.compose(arguments, tooluniverse, call_tool)[source]

Main composition function for DrugSafetyAnalyzer

Parameters:
  • arguments (dict) – Input arguments containing drug_name, patient_sex, serious_events_only

  • tooluniverse – ToolUniverse instance

  • call_tool – Function to call other tools

Returns

dict: Comprehensive drug safety analysis result

tooluniverse.compose_scripts.literature_tool module

Literature Search & Summary Tool Minimal compose tool perfect for paper screenshots

tooluniverse.compose_scripts.literature_tool.compose(arguments, tooluniverse, call_tool)[source]

Search literature and generate summary

tooluniverse.compose_scripts.output_summarizer module

Output Summarization Composer Script

This script handles the intelligent summarization of tool outputs by: 1. Chunking large outputs into manageable pieces 2. Processing each chunk with AI-powered summarization 3. Merging the summarized chunks into a coherent final summary

The script leverages ToolUniverse’s AgenticTool infrastructure to provide intelligent, context-aware summarization that focuses on information relevant to the original query.

tooluniverse.compose_scripts.output_summarizer.compose(arguments, tooluniverse, call_tool)[source]

Main composition function for output summarization.

This function orchestrates the complete summarization workflow: - Chunks the input text into manageable pieces - Summarizes each chunk using AI - Merges the summaries into a final coherent result

Parameters:
  • arguments (Dict[str, Any]) –

    Dictionary containing: - tool_output (str): The original tool output to be summarized - query_context (str): Context about the original query - tool_name (str): Name of the tool that generated the output - chunk_size (int, optional): Size of each chunk for processing - focus_areas (str, optional): Areas to focus on in summarization - max_summary_length (int, optional): Maximum length of final

    summary

  • tooluniverse – ToolUniverse instance for tool execution

  • call_tool – Function to call other tools within the composition

Returns
Dict[str, Any]: Dictionary containing:
  • success (bool): Whether summarization was successful

  • original_length (int): Length of original output

  • summary_length (int): Length of final summary

  • chunks_processed (int): Number of chunks processed

  • summary (str): The summarized output

  • tool_name (str): Name of the original tool

  • error (str, optional): Error message if summarization failed

tooluniverse.compose_scripts.tool_description_optimizer module

tooluniverse.compose_scripts.tool_description_optimizer.compose(arguments, tooluniverse, call_tool)[source]

tooluniverse.compose_scripts.tool_discover module

tooluniverse.compose_scripts.tool_discover.iterative_comprehensive_optimization(tool_config, call_tool, max_iterations=5, target_score=8.5, temp_dir=None)[source]

Comprehensive optimization with guaranteed minimum iterations and multi-agent improvement strategy

tooluniverse.compose_scripts.tool_discover.compose(arguments, tooluniverse, call_tool)[source]

General tool discovery and generation system

tooluniverse.compose_scripts.tool_discover.optimize_code(tool_config, optimization_context, call_tool)[source]

Wrapper function that calls the XML-based optimizer

tooluniverse.compose_scripts.tool_graph_composer module

Simplified and fixed tool_graph_composer.py This version includes better error handling and avoids the ‘unhashable type’ issue.

tooluniverse.compose_scripts.tool_graph_composer.compose(arguments, tooluniverse, call_tool)[source]

Compose function for building tool compatibility graphs.

Parameters:
  • arguments – Dictionary with composition parameters

  • tooluniverse – ToolUniverse instance

  • call_tool – Function to call other tools

Returns

Dictionary with results and file paths

tooluniverse.compose_scripts.tool_graph_generation module

Tool Graph Generation Compose Script

Efficiently evaluates directional data-flow relationships between all unique pairs of provided tool configs using one agentic tool:

  • ToolRelationshipDetector

Outputs a graph structure with edges representing valid directional relationships. Each edge stores: source, target, rationale.

Performance considerations:
  • Iterates i<j once (O(N^2/2) pairs)

  • Lightweight JSON serialization of minimal fields

  • Optional batching hook (currently sequential because call_tool likely remote)

param tool_configs:

type tool_configs:

list[dict]

param max_tools:

type max_tools:

int

param output_path:

type output_path:

str) path to write resulting graph JSON (default './tool_relationship_graph.json'

param save_intermediate_every:

type save_intermediate_every:

int) checkpoint frequency (default 5000 pairs processed

returns:

nodes, edges, stats

rtype:

dict with keys

tooluniverse.compose_scripts.tool_graph_generation.compose(arguments, tooluniverse, call_tool)[source]

tooluniverse.compose_scripts.tool_metadata_generator module

Tool Metadata Generation Pipeline Generates comprehensive metadata for a list of tools by extracting details from their configuration files

tooluniverse.compose_scripts.tool_metadata_generator.compose(arguments, tooluniverse, call_tool)[source]

Main composition function for Tool Metadata Generation

Parameters:
  • arguments (dict) – Input arguments containing a list of tool config JSONs as well as a tool_type_mappings dict for non-API tools (e.g., {‘Databases’: [‘XMLTool’]})

  • tooluniverse – ToolUniverse instance

  • call_tool – Function to call other tools

Returns

list: List of tool metadata dictionaries (JSON-compatible)