tooluniverse.ctg_tool module¶
- class tooluniverse.ctg_tool.ClinicalTrialsTool[source]¶
Bases:
RESTfulTool
- _map_param_names(arguments)[source]¶
Maps the parameter names in the arguments dictionary to the expected parameter names defined in the tool’s JSON configuration.
- _prepare_api_params(arguments)[source]¶
Prepares the dictionary of parameters for the API query string based on tool config and runtime arguments.
- _format_endpoint_url(arguments)[source]¶
Formats the endpoint URL by substituting path parameters (like {nctId}) with values from the arguments dictionary.
- run(arguments)[source]¶
Execute the tool.
The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.
- Parameters:
arguments (
dict, optional
) – Tool-specific argumentsstream_callback (
callable, optional
) – Callback for streaming responsesuse_cache (
bool, optional
) – Whether result caching is enabledvalidate (
bool, optional
) – Whether parameter validation was performed
Note
These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.
For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.
- class tooluniverse.ctg_tool.ClinicalTrialsSearchTool[source]¶
Bases:
ClinicalTrialsTool
- class tooluniverse.ctg_tool.ClinicalTrialsDetailsTool[source]¶
Bases:
ClinicalTrialsTool
- run(arguments)[source]¶
Execute the tool.
The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.
- Parameters:
arguments (
dict, optional
) – Tool-specific argumentsstream_callback (
callable, optional
) – Callback for streaming responsesuse_cache (
bool, optional
) – Whether result caching is enabledvalidate (
bool, optional
) – Whether parameter validation was performed
Note
These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.
For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.