RichardZhu52 commited on
Commit
4855afa
·
1 Parent(s): 792e93b

update expert eval with ui changes and using new data

Browse files
app.py CHANGED
@@ -1,13 +1,61 @@
1
  import gradio as gr
2
  from gradio_modal import Modal
 
3
  from huggingface_hub import hf_hub_download, list_repo_files
4
  import os, csv, datetime, sys
5
  import json
6
  from utils import format_chat, append_to_sheet, read_sheet_to_df
7
  import random
8
  import base64
 
 
9
  import re
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  def encode_image_to_base64(image_path):
12
  """Encodes an image file to a base64 string."""
13
  try:
@@ -43,42 +91,6 @@ except Exception as e:
43
  print(f"Error reading HTML file: {e}")
44
  TxAgent_Project_Page_HTML = "<p>Error: Project page content could not be loaded.</p>"
45
 
46
- # Load tool lists
47
- fda_drug_labeling_tools_path = "fda_drug_labeling_tools.json"
48
- monarch_tools_path = "monarch_tools.json"
49
- opentarget_tools_path = "opentarget_tools.json"
50
-
51
- try:
52
- with open(fda_drug_labeling_tools_path, 'r') as f:
53
- fda_data = json.load(f)
54
- fda_drug_labeling_tools_list = [item['name'] for item in fda_data if 'name' in item]
55
- except Exception as e:
56
- print(f"Error processing {fda_drug_labeling_tools_path}: {e}")
57
- fda_drug_labeling_tools_list = ["Error loading FDA tools"]
58
-
59
- try:
60
- with open(monarch_tools_path, 'r') as f:
61
- monarch_data = json.load(f)
62
- monarch_tools_list = [item['name'] for item in monarch_data if 'name' in item]
63
- except Exception as e:
64
- print(f"Error processing {monarch_tools_path}: {e}")
65
- monarch_tools_list = ["Error loading Monarch tools"]
66
-
67
- try:
68
- with open(opentarget_tools_path, 'r') as f:
69
- opentarget_data = json.load(f)
70
- opentarget_tools_list = [item['name'] for item in opentarget_data if 'name' in item]
71
- except Exception as e:
72
- print(f"Error processing {opentarget_tools_path}: {e}")
73
- opentarget_tools_list = ["Error loading OpenTarget tools"]
74
-
75
- #for labeling the different tool calls in format_chat
76
- tool_database_labels = {
77
- "**from approved FDA drug labels**": fda_drug_labeling_tools_list,
78
- "**from the Monarch Initiative databases**": monarch_tools_list,
79
- "**from the Open Targets database**": opentarget_tools_list,
80
- }
81
-
82
  # Define the six evaluation criteria as a list of dictionaries.
83
  criteria = [
84
  {
@@ -158,14 +170,16 @@ mapping = { #for pairwise mapping between model comparison selections
158
  "👎 Neither model did well": "neither"
159
  }
160
 
161
- #Prepare data
162
- REPO_ID = "RichardZhu52/TxAgent_human_eval"
163
- CROWDSOURCING_DATA_DIRECTORY = "crowdsourcing_eval_data_0430"
164
- TXAGENT_RESULTS_SHEET_BASE_NAME = "TxAgent_Human_Eval_Results"
165
- DISEASE_SPECIALTY_MAP_FILENAME = "disease_specialty_map.json"
166
- QUESTION_MAP_FILENAME = "question_map.json"
 
 
167
 
168
- def get_evaluator_questions(evaluator_id, all_files, evaluator_directory, question_map):
169
 
170
  # Filter to only the files in that directory
171
  evaluator_files = [f for f in all_files if f.startswith(f"{evaluator_directory}/")]
@@ -177,14 +191,25 @@ def get_evaluator_questions(evaluator_id, all_files, evaluator_directory, questi
177
  revision="main", #fetches the most recent version of the dataset each time this command is called
178
  filename=remote_path,
179
  # force_download=True,
 
180
  )
181
  with open(local_path, "r") as f:
182
  model_name_key = os.path.basename(remote_path).replace('.json', '')
183
  data_by_filename[model_name_key] = json.load(f)
184
 
 
 
 
 
 
 
 
 
 
 
 
185
  #FINALLY, MAKE SURE THEY DIDNT ALREADY FILL IT OUT. Must go through every tuple of (question_ID, TxAgent, other model) where other model could be any of the other files in data_by_filename
186
- model_names = [key for key in data_by_filename.keys() if key != 'txagent']
187
- evaluator_question_ids = question_map.get(evaluator_id).get('question_ids')
188
  full_question_ids_list = []
189
  for other_model_name in model_names:
190
  for q_id in evaluator_question_ids:
@@ -196,11 +221,11 @@ def get_evaluator_questions(evaluator_id, all_files, evaluator_directory, questi
196
  matched_pairs = set()
197
  for _, row in results_df.iterrows():
198
  q = row["Question ID"]
199
- # pick whichever response isn’t 'txagent'
200
  a, b = row["ResponseA_Model"], row["ResponseB_Model"]
201
- if a == "txagent" and b != "txagent":
202
  matched_pairs.add((q, b))
203
- elif b == "txagent" and a != "txagent":
204
  matched_pairs.add((q, a))
205
 
206
  # filter out any tuple whose (q_id, other_model) was already matched
@@ -221,14 +246,15 @@ def go_to_eval_progress_modal(name, email, evaluator_id, specialty_dd, subspecia
221
 
222
  # ADDED: Validate that name and email are non-empty before proceeding
223
  if not name or not email or not evaluator_id or not specialty_dd or not years_exp_radio:
224
- return gr.update(visible=True), gr.update(visible=False), None, "Please fill out all the required fields (name, email, evaluator ID, specialty, years of experience). If you are not a licensed physician with a specific specialty, please choose the specialty that most closely aligns with your biomedical expertise.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False), ""
225
 
226
  question_map_path = hf_hub_download(
227
  repo_id=REPO_ID,
228
- filename=QUESTION_MAP_FILENAME,
229
  repo_type="dataset", # or omit if it's a Model/Space
230
  # force_download=True, # ← always fetch new copy
231
- revision="main" # branch/tag/commit, fetches the most recent version of the dataset each time this command is called
 
232
  )
233
 
234
  # Load the question map from the downloaded file
@@ -236,19 +262,20 @@ def go_to_eval_progress_modal(name, email, evaluator_id, specialty_dd, subspecia
236
  question_map = json.load(f)
237
 
238
  #retrieve data from HF
239
- evaluator_directory = question_map.get(evaluator_id, {}).get('evaluator_name', None)
240
  if evaluator_directory is None:
241
  return gr.update(visible=True), gr.update(visible=False), None, "Invalid Evaluator ID, please try again.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False),""
242
  all_files = list_repo_files(
243
  repo_id=REPO_ID,
244
  repo_type="dataset",
245
  revision="main",
 
246
  )
247
 
248
- full_question_ids_list, data_by_filename = get_evaluator_questions(evaluator_id, all_files, evaluator_directory, question_map)
249
 
250
  if len(full_question_ids_list) == 0:
251
- return gr.update(visible=True), gr.update(visible=False), None, "Based on your submitted data, you have no more questions to evaluate. You may exit the page; we will follow-up if we require anything else from you. Thank you!", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False),""
252
 
253
  full_question_ids_list = sorted(full_question_ids_list, key=lambda x: str(x[0])+str(x[1]))
254
  #selected question is the first element
@@ -256,17 +283,17 @@ def go_to_eval_progress_modal(name, email, evaluator_id, specialty_dd, subspecia
256
 
257
  #Constructing question_for_eval, the question to evaluate this round
258
  txagent_matched_entry = next(
259
- (entry for entry in data_by_filename['txagent'] if entry.get("question_ID") == q_id),
260
  None
261
  )
262
  other_model_matched_entry = next(
263
- (entry for entry in data_by_filename[other_model_name] if entry.get("question_ID") == q_id),
264
  None
265
  )
266
 
267
  models_list = [
268
  {
269
- "model": "txagent",
270
  "reasoning_trace": txagent_matched_entry.get("solution")
271
  },
272
  {
@@ -278,7 +305,8 @@ def go_to_eval_progress_modal(name, email, evaluator_id, specialty_dd, subspecia
278
 
279
  question_for_eval = {
280
  "question": txagent_matched_entry.get("question"),
281
- "question_ID": q_id,
 
282
  "models": models_list,
283
  }
284
 
@@ -290,6 +318,7 @@ def go_to_eval_progress_modal(name, email, evaluator_id, specialty_dd, subspecia
290
 
291
  # Construct the question-specific elements of the pairwise rating page (page 1)
292
  page1_prompt = gr.HTML(f'<div style="background-color: #FFEFD5; border: 2px solid #FF8C00; padding: 10px; border-radius: 5px; color: black;"><strong style="color: black;">Prompt:</strong> {prompt_text}</div>')
 
293
  chat_a = gr.Chatbot(
294
  value=chat_A_value,
295
  type="messages",
@@ -312,7 +341,7 @@ def go_to_eval_progress_modal(name, email, evaluator_id, specialty_dd, subspecia
312
  avatar_images=None, # Optional: omit user/assistant icons
313
  rtl=False
314
  )
315
- return gr.update(visible=True), gr.update(visible=False), user_info,"", chat_a, chat_b, page1_prompt, question_for_eval, gr.update(visible=True), f"You are about to evaluate the next question. You have {len(full_question_ids_list)} question(s) remaining to evaluate."
316
 
317
  #goes to page 1 from confirmation modal that tells users how many questions they have left to evaluate
318
  def go_to_page1():
@@ -340,7 +369,7 @@ def go_to_page2(data_subset_state,*pairwise_values):
340
  pairwise_results_for_display = [gr.Markdown(f"***As a reminder, your pairwise comparison answer for this criterion was: {pairwise_list[i]}. Your answer choices will be restricted based on your comparison answer, but you may go back and change the comparison answer if you wish.***") for i in range(len(criteria))]
341
 
342
  if any(answer is None for answer in pairwise_list):
343
- return gr.update(visible=True), gr.update(visible=False), None, None, "Error: Please select an option for every pairwise comparison.", gr.Chatbot(), gr.Chatbot(), gr.HTML(), *pairwise_results_for_display
344
 
345
  chat_A_value = format_chat(data_subset_state['models'][0]['reasoning_trace'], tool_database_labels)
346
  chat_B_value = format_chat(data_subset_state['models'][1]['reasoning_trace'], tool_database_labels)
@@ -366,8 +395,9 @@ def go_to_page2(data_subset_state,*pairwise_values):
366
  )
367
 
368
  page2_prompt = gr.HTML(f'<div style="background-color: #FFEFD5; border: 2px solid #FF8C00; padding: 10px; border-radius: 5px; color: black;"><strong style="color: black;">Prompt:</strong> {prompt_text}</div>')
 
369
 
370
- return gr.update(visible=False), gr.update(visible=True), pairwise_list, comparison_reasons_list, "", chat_A_rating, chat_B_rating, page2_prompt, *pairwise_results_for_display
371
 
372
 
373
  # Callback to store scores for Response A.
@@ -417,6 +447,21 @@ def toggle_slider(is_unqualified):
417
  # When the checkbox is checked (True), set interactive to False to disable the slider.
418
  return gr.update(interactive=not is_unqualified)
419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  centered_col_css = """
421
  #centered-column {
422
  margin-left: auto;
@@ -434,6 +479,13 @@ centered_col_css = """
434
  color: white !important;
435
  border-color: #F08080 !important;
436
  }
 
 
 
 
 
 
 
437
  """
438
  with gr.Blocks(css=centered_col_css) as demo:
439
  # States to save information between pages.
@@ -441,6 +493,7 @@ with gr.Blocks(css=centered_col_css) as demo:
441
  pairwise_state = gr.State()
442
  scores_A_state = gr.State()
443
  comparison_reasons = gr.State()
 
444
  unqualified_A_state = gr.State()
445
  data_subset_state = gr.State()
446
 
@@ -489,12 +542,32 @@ with gr.Blocks(css=centered_col_css) as demo:
489
  - Each session requires a minimum commitment of 5-10 minutes to complete one question.
490
  - If you wish to evaluate multiple questions, you may do so; you will never be asked to re-evaluate questions you have already seen.
491
  - When evaluating a question, you will be asked to compare the responses of two different models to the question and then rate each model's response on a scale of 1-5.
 
492
  - You may use the Back and Next buttons at the bottom of each page to edit any of your responses before submitting.
493
- - You may use the Instruction Page and Home Page buttons at the bottom of each page to return to this page or the home page. Your progress will be saved but not submitted.
494
  - You must submit your answers to the current question before moving on to evaluate the next question.
495
  - You may stop in between questions and return at a later time; however, you must submit your answers to the current question if you would like them saved.
 
496
 
497
- By clicking 'Next' below, you will start the study, with your progress saved after submitting each question. If you have any other questions or concerns, please contact us directly. Thank you for your participation!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498
  """)
499
  gr.Markdown("## Please enter your information to get a question to evaluate. Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.")
500
  name = gr.Textbox(label="Name (required)")
@@ -524,6 +597,30 @@ with gr.Blocks(css=centered_col_css) as demo:
524
  with gr.Column(visible=False) as page1:
525
  gr.Markdown("## Part 1/2: Pairwise Comparison") #Make the number controlled by question indexing!
526
  page1_prompt = gr.HTML()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  with gr.Row():
528
  # ADDED: Use gr.Chatbot to display the scrollable chat window for Response A.
529
  with gr.Column():
@@ -587,6 +684,14 @@ with gr.Blocks(css=centered_col_css) as demo:
587
  gr.Markdown("## Part 2/2: Rate Model Responses")
588
  # ### EDIT: Show a highlighted prompt as on previous pages.
589
  page2_prompt = gr.HTML()
 
 
 
 
 
 
 
 
590
  # ### EDIT: Display both responses side-by-side using Chatbot windows.
591
  with gr.Row():
592
  with gr.Column():
@@ -717,7 +822,7 @@ with gr.Blocks(css=centered_col_css) as demo:
717
  label=f"Score for Response B - {crit['label']}",
718
  interactive=True)
719
  with gr.Row():
720
- clear_btn = gr.Button("Clear Selection", size="sm",elem_id="clear_btn")
721
  clear_btn.click(fn=clear_selection, outputs=[rating_a,rating_b])
722
 
723
  # wire each to re‐restrict the other on change
@@ -761,7 +866,7 @@ with gr.Blocks(css=centered_col_css) as demo:
761
  cancel_btn = gr.Button("Cancel")
762
 
763
  # --- Define Callback Functions for Confirmation Flow ---
764
- def build_row_dict(data_subset_state, user_info, pairwise, comparisons_reasons, *args):
765
  num_criteria = len(criteria)
766
  ratings_A_vals = list(args[:num_criteria])
767
  ratings_B_vals = list(args[num_criteria:])
@@ -785,6 +890,7 @@ with gr.Blocks(css=centered_col_css) as demo:
785
  "Prompt": prompt_text,
786
  "ResponseA_Model": response_A_model,
787
  "ResponseB_Model": response_B_model,
 
788
  }
789
 
790
  pairwise = [mapping.get(val, val) for val in pairwise]
@@ -797,16 +903,9 @@ with gr.Blocks(css=centered_col_css) as demo:
797
 
798
  return row
799
 
800
- # def final_submit(data_subset_state, user_info, pairwise, comparisons_reasons, *args):
801
-
802
- # row_dict = build_row_dict(data_subset_state, user_info, pairwise, comparisons_reasons, *args)
803
- # append_to_sheet(user_data=None, custom_row_dict=row_dict, custom_sheet_name=str(TXAGENT_RESULTS_SHEET_BASE_NAME), add_header_when_create_sheet=True)
804
-
805
- # return gr.update(visible=False), gr.update(visible=True), gr.update(visible=False)
806
-
807
- def final_submit(data_subset_state, user_info, pairwise, comparisons_reasons, *args):
808
  # --- Part 1: Submit the current results (Existing Logic) ---
809
- row_dict = build_row_dict(data_subset_state, user_info, pairwise, comparisons_reasons, *args)
810
  _, _, _, _, _, _, _, _, evaluator_id = user_info
811
  append_to_sheet(user_data=None, custom_row_dict=row_dict, custom_sheet_name=str(TXAGENT_RESULTS_SHEET_BASE_NAME + f"_{evaluator_id}"), add_header_when_create_sheet=True)
812
 
@@ -816,23 +915,25 @@ with gr.Blocks(css=centered_col_css) as demo:
816
  # --- Re-fetch data and filter questions (Same logic as before) ---
817
  question_map_path = hf_hub_download(
818
  repo_id=REPO_ID,
819
- filename=QUESTION_MAP_FILENAME,
820
  repo_type="dataset", # or omit if it's a Model/Space
821
  # force_download=True, # ← always fetch new copy
822
- revision="main" # branch/tag/commit, fetches the most recent version of the dataset each time this command is called
 
823
  )
824
 
825
  with open(question_map_path, 'r') as f:
826
  question_map = json.load(f)
827
 
828
- evaluator_directory = question_map.get(evaluator_id, {}).get('evaluator_name', None)
829
  all_files = list_repo_files(
830
  repo_id=REPO_ID,
831
  repo_type="dataset",
832
  revision="main",
 
833
  )
834
 
835
- full_question_ids_list, data_by_filename = get_evaluator_questions(evaluator_id, all_files, evaluator_directory, question_map)
836
  remaining_count = len(full_question_ids_list)
837
 
838
  # --- Part 3: Determine UI updates based on remaining count ---
@@ -849,6 +950,7 @@ with gr.Blocks(css=centered_col_css) as demo:
849
  None,
850
  None,
851
  None,
 
852
  None
853
  )
854
 
@@ -858,17 +960,17 @@ with gr.Blocks(css=centered_col_css) as demo:
858
 
859
  #Constructing question_for_eval, the question to evaluate this round
860
  txagent_matched_entry = next(
861
- (entry for entry in data_by_filename['txagent'] if entry.get("question_ID") == q_id),
862
  None
863
  )
864
  other_model_matched_entry = next(
865
- (entry for entry in data_by_filename[other_model_name] if entry.get("question_ID") == q_id),
866
  None
867
  )
868
 
869
  models_list = [
870
  {
871
- "model": "txagent",
872
  "reasoning_trace": txagent_matched_entry.get("solution")
873
  },
874
  {
@@ -880,7 +982,7 @@ with gr.Blocks(css=centered_col_css) as demo:
880
 
881
  question_for_eval = {
882
  "question": txagent_matched_entry.get("question"),
883
- "question_ID": q_id,
884
  "models": models_list,
885
  }
886
 
@@ -890,6 +992,7 @@ with gr.Blocks(css=centered_col_css) as demo:
890
 
891
  # Construct the question-specific elements of the pairwise rating page (page 1)
892
  page1_prompt = gr.HTML(f'<div style="background-color: #FFEFD5; border: 2px solid #FF8C00; padding: 10px; border-radius: 5px; color: black;"><strong style="color: black;">Prompt:</strong> {prompt_text}</div>')
 
893
  chat_a = gr.Chatbot(
894
  value=chat_A_value,
895
  type="messages",
@@ -925,21 +1028,8 @@ with gr.Blocks(css=centered_col_css) as demo:
925
  chat_a,
926
  chat_b,
927
  page1_prompt,
 
928
  question_for_eval)
929
-
930
- # except Exception as e:
931
- # error_message = f"Your submission was saved, but an error occurred while checking for remaining questions: {e}. Please try starting the process again by entering your details. If the problem persists, contact the administrator."
932
- # print(f"Error during recalculation in final_submit: {e}") # Keep logging for debugging
933
- # # *** MODIFIED RETURN ***: Error during recalculation
934
- # return (
935
- # gr.update(visible=True), # page0 (Show) - Send user back to start
936
- # gr.update(visible=False), # page2 (Hide)
937
- # gr.update(visible=False), # confirm_modal (Hide)
938
- # gr.update(visible=False), # eval_progress_modal (Hide)
939
- # "", # eval_progress_text (Clear)
940
- # gr.update(visible=False), # final_page (Hide)
941
- # error_message # page0_error_box (Update with error)
942
- # )
943
 
944
  def cancel_submission():
945
  # Cancel final submission: just hide the confirmation modal.
@@ -976,6 +1066,7 @@ with gr.Blocks(css=centered_col_css) as demo:
976
 
977
  # page2 elements that need to be reset
978
  gr.update(value=""), #page2_prompt
 
979
  gr.update(value=[]), #chat_a_rating
980
  gr.update(value=[]), #chat_b_rating
981
  gr.update(value=""), #result_text
@@ -1002,7 +1093,7 @@ with gr.Blocks(css=centered_col_css) as demo:
1002
  next_btn_0.click(
1003
  fn=go_to_eval_progress_modal,
1004
  inputs=[name, email, evaluator_id, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb, npi_id],
1005
- outputs=[page0, page1, user_info_state, page0_error_box, chat_a, chat_b, page1_prompt, data_subset_state,eval_progress_modal,eval_progress_text],
1006
  scroll_to_output=True
1007
  )
1008
 
@@ -1029,7 +1120,7 @@ with gr.Blocks(css=centered_col_css) as demo:
1029
  next_btn_1.click(
1030
  fn=go_to_page2, # ### EDIT: Rename or update the function to simply pass the pairwise inputs if needed.
1031
  inputs=[data_subset_state,*pairwise_inputs,*comparison_reasons_inputs],
1032
- outputs=[page1, page2, pairwise_state, comparison_reasons, page1_error_box, chat_a_rating, chat_b_rating, page2_prompt, *pairwise_results_for_display],
1033
  scroll_to_output=True
1034
  )
1035
 
@@ -1082,7 +1173,7 @@ with gr.Blocks(css=centered_col_css) as demo:
1082
  # )
1083
  question_submission_event = yes_btn.click(
1084
  fn=final_submit,
1085
- inputs=[data_subset_state, user_info_state, pairwise_state, comparison_reasons, *ratings_A, *ratings_B],
1086
  outputs=[
1087
  page0, # Controlled by final_submit return value 1
1088
  page2, # Controlled by final_submit return value 2
@@ -1094,6 +1185,7 @@ with gr.Blocks(css=centered_col_css) as demo:
1094
  chat_a,
1095
  chat_b,
1096
  page1_prompt,
 
1097
  data_subset_state
1098
  ],
1099
  scroll_to_output=True
@@ -1131,6 +1223,7 @@ with gr.Blocks(css=centered_col_css) as demo:
1131
 
1132
  # page2 elements that need to be reset
1133
  page2_prompt,
 
1134
  chat_a_rating,
1135
  chat_b_rating,
1136
  result_text,
 
1
  import gradio as gr
2
  from gradio_modal import Modal
3
+ from gradio_pdf import PDF
4
  from huggingface_hub import hf_hub_download, list_repo_files
5
  import os, csv, datetime, sys
6
  import json
7
  from utils import format_chat, append_to_sheet, read_sheet_to_df
8
  import random
9
  import base64
10
+ import io
11
+ from PIL import Image
12
  import re
13
 
14
+ #Required file paths
15
+ REPO_ID = "agenticx/TxAgentEvalData"
16
+ EVALUATOR_MAP_DICT = "evaluator_map_dict.json"
17
+ TXAGENT_RESULTS_SHEET_BASE_NAME = "TxAgent_Human_Eval_Results_CROWDSOURCED"
18
+
19
+ #Load tool lists from 'tool_lists' subdirectory---make sure to update this with the latest from ToolUniverse if necessary!
20
+ tools_dir = os.path.join(os.getcwd(), 'tool_lists')
21
+
22
+ # Initialize an empty dictionary to store the results
23
+ results = {}
24
+
25
+ # Iterate over all files in the 'tools' directory
26
+ for filename in os.listdir(tools_dir):
27
+ # Process only files that end with '.json'
28
+ if filename.endswith('.json'):
29
+ filepath = os.path.join(tools_dir, filename)
30
+ key = os.path.splitext(filename)[0] # Remove '.json' extension
31
+ try:
32
+ with open(filepath, 'r', encoding='utf-8') as f:
33
+ data = json.load(f)
34
+ # Extract 'name' fields if present
35
+ names = [item['name'] for item in data if isinstance(item, dict) and 'name' in item]
36
+ results[key] = names
37
+ except Exception as e:
38
+ print(f"Error processing {filename}: {e}")
39
+ results[key] = [f"Error loading {filename}"]
40
+
41
+ #for labeling the different tool calls in format_chat
42
+ tool_database_labels_raw = {
43
+ "chembl_tools": "**from the ChEMBL database**",
44
+ "efo_tools": "**from the Experimental Factor Ontology**",
45
+ "europe_pmc_tools": "**from the Europe PMC database**",
46
+ "fda_drug_adverse_event_tools": "**from the FDA Adverse Event Reporting System**",
47
+ "fda_drug_labeling_tools": "**from approved FDA drug labels**",
48
+ "monarch_tools": "**from the Monarch Initiative databases**",
49
+ "opentarget_tools": "**from the Open Targets database**",
50
+ "pubtator_tools": "**from PubTator-accessible PubMed and PMC biomedical literature**",
51
+ "semantic_scholar_tools": "**from Semantic-Scholar-accessible literature**"
52
+ }
53
+ tool_database_labels = {
54
+ tool_database_labels_raw[key]: results[key]
55
+ for key in results
56
+ if key in tool_database_labels_raw
57
+ }
58
+
59
  def encode_image_to_base64(image_path):
60
  """Encodes an image file to a base64 string."""
61
  try:
 
91
  print(f"Error reading HTML file: {e}")
92
  TxAgent_Project_Page_HTML = "<p>Error: Project page content could not be loaded.</p>"
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  # Define the six evaluation criteria as a list of dictionaries.
95
  criteria = [
96
  {
 
170
  "👎 Neither model did well": "neither"
171
  }
172
 
173
+ def preprocess_question_id(question_id):
174
+ if isinstance(question_id, str):
175
+ return question_id
176
+ elif isinstance(question_id, list) and len(question_id) == 1:
177
+ return question_id[0]
178
+ else:
179
+ print("Error: Invalid question ID format. Expected a string or a single-element list.")
180
+ return None
181
 
182
+ def get_evaluator_questions(evaluator_id, all_files, evaluator_directory):
183
 
184
  # Filter to only the files in that directory
185
  evaluator_files = [f for f in all_files if f.startswith(f"{evaluator_directory}/")]
 
191
  revision="main", #fetches the most recent version of the dataset each time this command is called
192
  filename=remote_path,
193
  # force_download=True,
194
+ token = os.getenv("HF_TOKEN")
195
  )
196
  with open(local_path, "r") as f:
197
  model_name_key = os.path.basename(remote_path).replace('.json', '')
198
  data_by_filename[model_name_key] = json.load(f)
199
 
200
+
201
+ evaluator_question_ids = []
202
+ # Assuming 'TxAgent-T1-Llama-3.1-8B' data is representative for question IDs and associated diseases
203
+ if 'TxAgent-T1-Llama-3.1-8B' in data_by_filename:
204
+ for entry in data_by_filename['TxAgent-T1-Llama-3.1-8B']:
205
+ question_id = preprocess_question_id(entry.get("id"))
206
+ evaluator_question_ids.append(question_id)
207
+ # Handle case where no relevant questions are found based on specialty
208
+ if not evaluator_question_ids:
209
+ return [], data_by_filename
210
+
211
  #FINALLY, MAKE SURE THEY DIDNT ALREADY FILL IT OUT. Must go through every tuple of (question_ID, TxAgent, other model) where other model could be any of the other files in data_by_filename
212
+ model_names = [key for key in data_by_filename.keys() if key != 'TxAgent-T1-Llama-3.1-8B']
 
213
  full_question_ids_list = []
214
  for other_model_name in model_names:
215
  for q_id in evaluator_question_ids:
 
221
  matched_pairs = set()
222
  for _, row in results_df.iterrows():
223
  q = row["Question ID"]
224
+ # pick whichever response isn’t 'TxAgent-T1-Llama-3.1-8B'
225
  a, b = row["ResponseA_Model"], row["ResponseB_Model"]
226
+ if a == 'TxAgent-T1-Llama-3.1-8B' and b != 'TxAgent-T1-Llama-3.1-8B':
227
  matched_pairs.add((q, b))
228
+ elif b == 'TxAgent-T1-Llama-3.1-8B' and a != 'TxAgent-T1-Llama-3.1-8B':
229
  matched_pairs.add((q, a))
230
 
231
  # filter out any tuple whose (q_id, other_model) was already matched
 
246
 
247
  # ADDED: Validate that name and email are non-empty before proceeding
248
  if not name or not email or not evaluator_id or not specialty_dd or not years_exp_radio:
249
+ return gr.update(visible=True), gr.update(visible=False), None, "Please fill out all the required fields (name, email, evaluator ID, specialty, years of experience). If you are not a licensed physician with a specific specialty, please choose the specialty that most closely aligns with your biomedical expertise.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.Markdown(),gr.State(),gr.update(visible=False), ""
250
 
251
  question_map_path = hf_hub_download(
252
  repo_id=REPO_ID,
253
+ filename=EVALUATOR_MAP_DICT,
254
  repo_type="dataset", # or omit if it's a Model/Space
255
  # force_download=True, # ← always fetch new copy
256
+ revision="main", # branch/tag/commit, fetches the most recent version of the dataset each time this command is called
257
+ token = os.getenv("HF_TOKEN")
258
  )
259
 
260
  # Load the question map from the downloaded file
 
262
  question_map = json.load(f)
263
 
264
  #retrieve data from HF
265
+ evaluator_directory = question_map.get(evaluator_id, None)
266
  if evaluator_directory is None:
267
  return gr.update(visible=True), gr.update(visible=False), None, "Invalid Evaluator ID, please try again.", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.State(),gr.update(visible=False),""
268
  all_files = list_repo_files(
269
  repo_id=REPO_ID,
270
  repo_type="dataset",
271
  revision="main",
272
+ token = os.getenv("HF_TOKEN")
273
  )
274
 
275
+ full_question_ids_list, data_by_filename = get_evaluator_questions(evaluator_id, all_files, evaluator_directory)
276
 
277
  if len(full_question_ids_list) == 0:
278
+ return gr.update(visible=True), gr.update(visible=False), None, "Based on your submitted data, you have no more questions to evaluate. You may exit the page; we will follow-up if we require anything else from you. Thank you!", gr.Chatbot(), gr.Chatbot(), gr.HTML(),gr.Markdown(),gr.State(),gr.update(visible=False),""
279
 
280
  full_question_ids_list = sorted(full_question_ids_list, key=lambda x: str(x[0])+str(x[1]))
281
  #selected question is the first element
 
283
 
284
  #Constructing question_for_eval, the question to evaluate this round
285
  txagent_matched_entry = next(
286
+ (entry for entry in data_by_filename['TxAgent-T1-Llama-3.1-8B'] if preprocess_question_id(entry.get("id")) == q_id),
287
  None
288
  )
289
  other_model_matched_entry = next(
290
+ (entry for entry in data_by_filename[other_model_name] if preprocess_question_id(entry.get("id")) == q_id),
291
  None
292
  )
293
 
294
  models_list = [
295
  {
296
+ "model": 'TxAgent-T1-Llama-3.1-8B',
297
  "reasoning_trace": txagent_matched_entry.get("solution")
298
  },
299
  {
 
305
 
306
  question_for_eval = {
307
  "question": txagent_matched_entry.get("question"),
308
+ "correct_answer": txagent_matched_entry.get("correct_answer"),
309
+ "id": q_id,
310
  "models": models_list,
311
  }
312
 
 
318
 
319
  # Construct the question-specific elements of the pairwise rating page (page 1)
320
  page1_prompt = gr.HTML(f'<div style="background-color: #FFEFD5; border: 2px solid #FF8C00; padding: 10px; border-radius: 5px; color: black;"><strong style="color: black;">Prompt:</strong> {prompt_text}</div>')
321
+ page1_reference_answer = gr.Markdown(txagent_matched_entry.get("correct_answer"))
322
  chat_a = gr.Chatbot(
323
  value=chat_A_value,
324
  type="messages",
 
341
  avatar_images=None, # Optional: omit user/assistant icons
342
  rtl=False
343
  )
344
+ return gr.update(visible=True), gr.update(visible=False), user_info,"", chat_a, chat_b, page1_prompt, page1_reference_answer, question_for_eval, gr.update(visible=True), f"You are about to evaluate the next question. You have {len(full_question_ids_list)} question(s) remaining to evaluate."
345
 
346
  #goes to page 1 from confirmation modal that tells users how many questions they have left to evaluate
347
  def go_to_page1():
 
369
  pairwise_results_for_display = [gr.Markdown(f"***As a reminder, your pairwise comparison answer for this criterion was: {pairwise_list[i]}. Your answer choices will be restricted based on your comparison answer, but you may go back and change the comparison answer if you wish.***") for i in range(len(criteria))]
370
 
371
  if any(answer is None for answer in pairwise_list):
372
+ return gr.update(visible=True), gr.update(visible=False), None, None, "Error: Please select an option for every pairwise comparison.", gr.Chatbot(), gr.Chatbot(), gr.HTML(), gr.Markdown(),*pairwise_results_for_display
373
 
374
  chat_A_value = format_chat(data_subset_state['models'][0]['reasoning_trace'], tool_database_labels)
375
  chat_B_value = format_chat(data_subset_state['models'][1]['reasoning_trace'], tool_database_labels)
 
395
  )
396
 
397
  page2_prompt = gr.HTML(f'<div style="background-color: #FFEFD5; border: 2px solid #FF8C00; padding: 10px; border-radius: 5px; color: black;"><strong style="color: black;">Prompt:</strong> {prompt_text}</div>')
398
+ page2_reference_answer = gr.Markdown(data_subset_state['correct_answer'])
399
 
400
+ return gr.update(visible=False), gr.update(visible=True), pairwise_list, comparison_reasons_list, "", chat_A_rating, chat_B_rating, page2_prompt, page2_reference_answer, *pairwise_results_for_display
401
 
402
 
403
  # Callback to store scores for Response A.
 
447
  # When the checkbox is checked (True), set interactive to False to disable the slider.
448
  return gr.update(interactive=not is_unqualified)
449
 
450
+ #show reference answer
451
+ def toggle_reference(selection):
452
+ if selection == "Show Reference Answer":
453
+ return gr.update(visible=True)
454
+ else:
455
+ return gr.update(visible=False)
456
+
457
+ #nonsense button helper
458
+ def mark_invalid_question(btn_clicked_status):
459
+ new_status = not btn_clicked_status
460
+ if new_status == True:
461
+ return new_status, gr.update(value="Undo; this question makes biomedical sense", variant="primary")
462
+ else:
463
+ return new_status, gr.update(value="This question does not make sense or is not biomedically-relevant",variant="stop")
464
+
465
  centered_col_css = """
466
  #centered-column {
467
  margin-left: auto;
 
479
  color: white !important;
480
  border-color: #F08080 !important;
481
  }
482
+ #reference-box {
483
+ background-color: #9191FF !important;
484
+ color: white !important;
485
+ border: 1px solid #ccc;
486
+ padding: 10px;
487
+ border-radius: 5px;
488
+ }
489
  """
490
  with gr.Blocks(css=centered_col_css) as demo:
491
  # States to save information between pages.
 
493
  pairwise_state = gr.State()
494
  scores_A_state = gr.State()
495
  comparison_reasons = gr.State()
496
+ nonsense_btn_clicked = gr.State(False)
497
  unqualified_A_state = gr.State()
498
  data_subset_state = gr.State()
499
 
 
542
  - Each session requires a minimum commitment of 5-10 minutes to complete one question.
543
  - If you wish to evaluate multiple questions, you may do so; you will never be asked to re-evaluate questions you have already seen.
544
  - When evaluating a question, you will be asked to compare the responses of two different models to the question and then rate each model's response on a scale of 1-5.
545
+ - If you feel that a question does not make sense or is not biomedically relevant, there is a RED BUTTON at the top of the first model comparison page to indicate this
546
  - You may use the Back and Next buttons at the bottom of each page to edit any of your responses before submitting.
547
+ - You may use the Home Page button at the bottom of each page to the home page. Your progress will be saved but not submitted.
548
  - You must submit your answers to the current question before moving on to evaluate the next question.
549
  - You may stop in between questions and return at a later time; however, you must submit your answers to the current question if you would like them saved.
550
+ - Please review the example question and LLM model response below:
551
 
552
+ """)
553
+ # Assume 'your_image.png' is in the same directory
554
+ with open("anatomyofAgentResponse.jpg", "rb") as image_file:
555
+ img = Image.open(image_file)
556
+ new_size = (int(img.width * 0.5), int(img.height * 0.5))
557
+ img = img.resize(new_size, Image.LANCZOS)
558
+ buffer = io.BytesIO()
559
+ img.save(buffer, format="PNG")
560
+ encoded_string = base64.b64encode(buffer.getvalue()).decode("utf-8")
561
+ #encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
562
+
563
+ image_html = f'<div style="text-align:center;"><img src="data:image/png;base64,{encoded_string}" alt="Your Image"></div>'
564
+ ReasoningTraceExampleHTML = f"""
565
+ <div>
566
+ {image_html}
567
+ </div>
568
+ """
569
+ gr.HTML(ReasoningTraceExampleHTML)
570
+ gr.Markdown("""By clicking 'Next' below, you will start the study, with your progress saved after submitting each question. If you have any other questions or concerns, please contact us directly. Thank you for your participation!
571
  """)
572
  gr.Markdown("## Please enter your information to get a question to evaluate. Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.")
573
  name = gr.Textbox(label="Name (required)")
 
597
  with gr.Column(visible=False) as page1:
598
  gr.Markdown("## Part 1/2: Pairwise Comparison") #Make the number controlled by question indexing!
599
  page1_prompt = gr.HTML()
600
+
601
+ # Add small red button under the prompt
602
+ nonsense_btn = gr.Button(
603
+ "This question does not make sense or is not biomedically-relevant",
604
+ size="sm",
605
+ variant="stop", # red variant
606
+ elem_id="invalid-question-btn"
607
+ )
608
+
609
+ nonsense_btn.click(
610
+ fn=mark_invalid_question,
611
+ inputs=[nonsense_btn_clicked],
612
+ outputs=[nonsense_btn_clicked, nonsense_btn],
613
+ queue=False,
614
+ )
615
+
616
+ with gr.Accordion("Show reference answer (this is ONE correct answer, but there may be multiple)", open=False, elem_id="reference-box"):
617
+ page1_reference_answer = gr.Markdown(
618
+ """
619
+ **Reference Answer:**
620
+
621
+ This is the reference answer content.
622
+ """
623
+ )
624
  with gr.Row():
625
  # ADDED: Use gr.Chatbot to display the scrollable chat window for Response A.
626
  with gr.Column():
 
684
  gr.Markdown("## Part 2/2: Rate Model Responses")
685
  # ### EDIT: Show a highlighted prompt as on previous pages.
686
  page2_prompt = gr.HTML()
687
+ with gr.Accordion("Show reference answer (this is ONE correct answer, but there may be multiple)", open=False, elem_id="reference-box"):
688
+ page2_reference_answer = gr.Markdown(
689
+ """
690
+ **Reference Answer:**
691
+
692
+ This is the reference answer content.
693
+ """
694
+ )
695
  # ### EDIT: Display both responses side-by-side using Chatbot windows.
696
  with gr.Row():
697
  with gr.Column():
 
822
  label=f"Score for Response B - {crit['label']}",
823
  interactive=True)
824
  with gr.Row():
825
+ clear_btn = gr.Button("Clear Selection", size="sm", elem_id="clear_btn")
826
  clear_btn.click(fn=clear_selection, outputs=[rating_a,rating_b])
827
 
828
  # wire each to re‐restrict the other on change
 
866
  cancel_btn = gr.Button("Cancel")
867
 
868
  # --- Define Callback Functions for Confirmation Flow ---
869
+ def build_row_dict(data_subset_state, user_info, pairwise, comparisons_reasons, nonsense_btn_clicked, *args):
870
  num_criteria = len(criteria)
871
  ratings_A_vals = list(args[:num_criteria])
872
  ratings_B_vals = list(args[num_criteria:])
 
890
  "Prompt": prompt_text,
891
  "ResponseA_Model": response_A_model,
892
  "ResponseB_Model": response_B_model,
893
+ "Question Makes No Sense or Biomedically Irrelevant": nonsense_btn_clicked,
894
  }
895
 
896
  pairwise = [mapping.get(val, val) for val in pairwise]
 
903
 
904
  return row
905
 
906
+ def final_submit(data_subset_state, user_info, pairwise, comparisons_reasons, nonsense_btn_clicked, *args):
 
 
 
 
 
 
 
907
  # --- Part 1: Submit the current results (Existing Logic) ---
908
+ row_dict = build_row_dict(data_subset_state, user_info, pairwise, comparisons_reasons, nonsense_btn_clicked, *args)
909
  _, _, _, _, _, _, _, _, evaluator_id = user_info
910
  append_to_sheet(user_data=None, custom_row_dict=row_dict, custom_sheet_name=str(TXAGENT_RESULTS_SHEET_BASE_NAME + f"_{evaluator_id}"), add_header_when_create_sheet=True)
911
 
 
915
  # --- Re-fetch data and filter questions (Same logic as before) ---
916
  question_map_path = hf_hub_download(
917
  repo_id=REPO_ID,
918
+ filename=EVALUATOR_MAP_DICT,
919
  repo_type="dataset", # or omit if it's a Model/Space
920
  # force_download=True, # ← always fetch new copy
921
+ revision="main", # branch/tag/commit, fetches the most recent version of the dataset each time this command is called
922
+ token = os.getenv("HF_TOKEN")
923
  )
924
 
925
  with open(question_map_path, 'r') as f:
926
  question_map = json.load(f)
927
 
928
+ evaluator_directory = question_map.get(evaluator_id, None)
929
  all_files = list_repo_files(
930
  repo_id=REPO_ID,
931
  repo_type="dataset",
932
  revision="main",
933
+ token = os.getenv("HF_TOKEN")
934
  )
935
 
936
+ full_question_ids_list, data_by_filename = get_evaluator_questions(evaluator_id, all_files, evaluator_directory)
937
  remaining_count = len(full_question_ids_list)
938
 
939
  # --- Part 3: Determine UI updates based on remaining count ---
 
950
  None,
951
  None,
952
  None,
953
+ None,
954
  None
955
  )
956
 
 
960
 
961
  #Constructing question_for_eval, the question to evaluate this round
962
  txagent_matched_entry = next(
963
+ (entry for entry in data_by_filename['TxAgent-T1-Llama-3.1-8B'] if preprocess_question_id(entry.get("id")) == q_id),
964
  None
965
  )
966
  other_model_matched_entry = next(
967
+ (entry for entry in data_by_filename[other_model_name] if preprocess_question_id(entry.get("id")) == q_id),
968
  None
969
  )
970
 
971
  models_list = [
972
  {
973
+ "model": 'TxAgent-T1-Llama-3.1-8B',
974
  "reasoning_trace": txagent_matched_entry.get("solution")
975
  },
976
  {
 
982
 
983
  question_for_eval = {
984
  "question": txagent_matched_entry.get("question"),
985
+ "id": q_id,
986
  "models": models_list,
987
  }
988
 
 
992
 
993
  # Construct the question-specific elements of the pairwise rating page (page 1)
994
  page1_prompt = gr.HTML(f'<div style="background-color: #FFEFD5; border: 2px solid #FF8C00; padding: 10px; border-radius: 5px; color: black;"><strong style="color: black;">Prompt:</strong> {prompt_text}</div>')
995
+ page1_reference_answer = gr.Markdown(txagent_matched_entry.get("correct_answer"))
996
  chat_a = gr.Chatbot(
997
  value=chat_A_value,
998
  type="messages",
 
1028
  chat_a,
1029
  chat_b,
1030
  page1_prompt,
1031
+ page1_reference_answer,
1032
  question_for_eval)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1033
 
1034
  def cancel_submission():
1035
  # Cancel final submission: just hide the confirmation modal.
 
1066
 
1067
  # page2 elements that need to be reset
1068
  gr.update(value=""), #page2_prompt
1069
+ gr.update(value=""), #page2_reference_answer
1070
  gr.update(value=[]), #chat_a_rating
1071
  gr.update(value=[]), #chat_b_rating
1072
  gr.update(value=""), #result_text
 
1093
  next_btn_0.click(
1094
  fn=go_to_eval_progress_modal,
1095
  inputs=[name, email, evaluator_id, specialty_dd, subspecialty_dd, years_exp_radio, exp_explanation_tb, npi_id],
1096
+ outputs=[page0, page1, user_info_state, page0_error_box, chat_a, chat_b, page1_prompt, page1_reference_answer, data_subset_state,eval_progress_modal,eval_progress_text],
1097
  scroll_to_output=True
1098
  )
1099
 
 
1120
  next_btn_1.click(
1121
  fn=go_to_page2, # ### EDIT: Rename or update the function to simply pass the pairwise inputs if needed.
1122
  inputs=[data_subset_state,*pairwise_inputs,*comparison_reasons_inputs],
1123
+ outputs=[page1, page2, pairwise_state, comparison_reasons, page1_error_box, chat_a_rating, chat_b_rating, page2_prompt, page2_reference_answer,*pairwise_results_for_display],
1124
  scroll_to_output=True
1125
  )
1126
 
 
1173
  # )
1174
  question_submission_event = yes_btn.click(
1175
  fn=final_submit,
1176
+ inputs=[data_subset_state, user_info_state, pairwise_state, comparison_reasons, nonsense_btn_clicked, *ratings_A, *ratings_B],
1177
  outputs=[
1178
  page0, # Controlled by final_submit return value 1
1179
  page2, # Controlled by final_submit return value 2
 
1185
  chat_a,
1186
  chat_b,
1187
  page1_prompt,
1188
+ page1_reference_answer,
1189
  data_subset_state
1190
  ],
1191
  scroll_to_output=True
 
1223
 
1224
  # page2 elements that need to be reset
1225
  page2_prompt,
1226
+ page2_reference_answer,
1227
  chat_a_rating,
1228
  chat_b_rating,
1229
  result_text,
tool_lists/chembl_tools.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "ChEMBLTool",
4
+ "name": "ChEMBL_search_similar_molecules",
5
+ "description": "Search for molecules similar to a given SMILES, chembl_id, or compound or drug name, using the ChEMBL Web Services.",
6
+ "parameter": {
7
+ "type": "object",
8
+ "properties": {
9
+ "query": { "type": "string", "description": "SMILES string, chembl_id, or compound or drug name." },
10
+ "similarity_threshold": { "type": "integer", "description": "Similarity threshold (0–100).", "default": 80 },
11
+ "max_results": { "type": "integer", "description": "Maximum number of results to return.", "default": 20 }
12
+ },
13
+ "required": ["query"]
14
+ }
15
+ }
16
+ ]
tool_lists/efo_tools.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "EFOTool",
4
+ "name": "OSL_get_efo_id_by_disease_name",
5
+ "description": "Tool to lookup Experimental Factor Ontology (EFO) IDs for diseases via the EMBL-EBI OLS API.",
6
+ "parameter": {
7
+ "type": "object",
8
+ "properties": {
9
+ "disease": {
10
+ "type": "string",
11
+ "description": "Search query for diseases. Provide the disease name to lookup the corresponding EFO ID."
12
+ }
13
+ },
14
+ "required": ["disease"]
15
+ }
16
+ }
17
+ ]
tool_lists/europe_pmc_tools.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "EuropePMCTool",
4
+ "name": "EuropePMC_search_articles",
5
+ "description": "Search for articles on Europe PMC including abstracts. The tool queries the Europe PMC web service using provided keywords and returns articles with details such as title, abstract, journal, publication year, and a URL to the full article.",
6
+ "parameter": {
7
+ "type": "object",
8
+ "properties": {
9
+ "query": {
10
+ "type": "string",
11
+ "description": "Search query for Europe PMC. Use keywords separated by spaces to refine your search."
12
+ },
13
+ "limit": {
14
+ "type": "integer",
15
+ "description": "Number of articles to return. This sets the maximum number of articles retrieved from Europe PMC.",
16
+ "default": 5
17
+ }
18
+ },
19
+ "required": ["query"]
20
+ }
21
+ }
22
+ ]
tool_lists/fda_drug_adverse_event_tools.json ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "FDADrugAdverseEventTool",
4
+ "name": "FAERS_count_reactions_by_drug_event",
5
+ "description": "Count the number of adverse reactions reported for a given drug, filtered by patient details, event seriousness, and reaction outcomes. Data source: FDA Adverse Event Reporting System (FAERS).",
6
+ "parameter": {
7
+ "type": "object",
8
+ "properties": {
9
+ "medicinalproduct": { "type": "string", "description": "Drug name." },
10
+ "patient.patientsex": { "type": "string", "enum": ["Male", "Female"], "description": "Patient sex, leave it blank if you don't want to apply a filter." },
11
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate", "Infant", "Child", "Adolescent", "Adult", "Elderly"], "description": "Patient age group." },
12
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "Country where event occurred." },
13
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Whether the event was serious." },
14
+ "seriousnessdeath": { "type": "string", "enum": ["Yes", "No"], "description": "Was death reported?" }
15
+ },
16
+ "required": ["medicinalproduct"]
17
+ },
18
+ "fields": {
19
+ "search_fields": {
20
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
21
+ "patient.patientsex": ["patient.patientsex"],
22
+ "patient.patientagegroup": ["patient.patientagegroup"],
23
+ "occurcountry": ["occurcountry"],
24
+ "serious": ["serious"],
25
+ "seriousnessdeath": ["seriousnessdeath"]
26
+ },
27
+ "return_fields": ["patient.reaction.reactionmeddrapt.exact"]
28
+ }
29
+ },
30
+ {
31
+ "type": "FDADrugAdverseEventTool",
32
+ "name": "FAERS_count_drugs_by_drug_event",
33
+ "description": "Count the number of different drugs involved in FDA adverse event reports, filtered by patient details, country, and seriousness. Data source: FDA Adverse Event Reporting System (FAERS).",
34
+ "parameter": {
35
+ "type": "object",
36
+ "properties": {
37
+ "patient.patientsex": { "type": "string", "enum": ["Male", "Female"], "description": "Patient sex, leave it blank if you don't want to apply a filter." },
38
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate", "Infant", "Child", "Adolescent", "Adult", "Elderly"], "description": "Patient age group." },
39
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "Country where event occurred." },
40
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Whether the event was serious." }
41
+ },
42
+ "required": []
43
+ },
44
+ "fields": {
45
+ "search_fields": {
46
+ "patient.patientsex": ["patient.patientsex"],
47
+ "patient.patientagegroup": ["patient.patientagegroup"],
48
+ "occurcountry": ["occurcountry"],
49
+ "serious": ["serious"]
50
+ },
51
+ "return_fields": ["patient.drug.medicinalproduct.exact"]
52
+ }
53
+ },
54
+ {
55
+ "type": "FDADrugAdverseEventTool",
56
+ "name": "FAERS_count_country_by_drug_event",
57
+ "description": "Count the number of adverse event reports per country of occurrence, filtered by drug, patient demographics, and seriousness. Data source: FDA Adverse Event Reporting System (FAERS).",
58
+ "parameter": {
59
+ "type": "object",
60
+ "properties": {
61
+ "medicinalproduct": { "type": "string", "description": "Drug name." },
62
+ "patient.patientsex": { "type": "string", "enum": ["Male", "Female"], "description": "Patient sex, leave it blank if you don't want to apply a filter." },
63
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate", "Infant", "Child", "Adolescent", "Adult", "Elderly"], "description": "Patient age group." },
64
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Whether the event was serious." }
65
+ },
66
+ "required": []
67
+ },
68
+ "fields": {
69
+ "search_fields": {
70
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
71
+ "patient.patientsex": ["patient.patientsex"],
72
+ "patient.patientagegroup": ["patient.patientagegroup"],
73
+ "serious": ["serious"]
74
+ },
75
+ "return_fields": ["occurcountry.exact"]
76
+ }
77
+ },
78
+ {
79
+ "type": "FDADrugAdverseEventTool",
80
+ "name": "FAERS_count_reportercountry_by_drug_event",
81
+ "description": "Count the number of FDA adverse event reports grouped by the country of the primary reporter. Data source: FDA Adverse Event Reporting System (FAERS).",
82
+ "parameter": {
83
+ "type": "object",
84
+ "properties": {
85
+ "medicinalproduct": { "type": "string", "description": "Drug name." },
86
+ "patient.patientsex": { "type": "string", "enum": ["Male", "Female"], "description": "Patient sex, leave it blank if you don't want to apply a filter." },
87
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate", "Infant", "Child", "Adolescent", "Adult", "Elderly"], "description": "Patient age group." },
88
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Whether the event was serious." }
89
+ },
90
+ "required": []
91
+ },
92
+ "fields": {
93
+ "search_fields": {
94
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
95
+ "patient.patientsex": ["patient.patientsex"],
96
+ "patient.patientagegroup": ["patient.patientagegroup"],
97
+ "serious": ["serious"]
98
+ },
99
+ "return_fields": ["primarysource.reportercountry.exact"]
100
+ }
101
+ },
102
+ {
103
+ "type": "FDADrugAdverseEventTool",
104
+ "name": "FAERS_count_seriousness_by_drug_event",
105
+ "description": "Count the number of adverse event reports classified as serious or non-serious, filtered by drug and patient demographics. In results, term Serious means: 'The adverse event resulted in death, a life threatening condition, hospitalization, disability, congenital anomaly, or other serious condition', term Non-serious means 'The adverse event did not result in any of the above' Data source: FDA Adverse Event Reporting System (FAERS).",
106
+ "parameter": {
107
+ "type": "object",
108
+ "properties": {
109
+ "medicinalproduct": { "type": "string", "description": "Drug name." },
110
+ "patient.patientsex": { "type": "string", "enum": ["Male", "Female"], "description": "Patient sex, leave it blank if you don't want to apply a filter." },
111
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate", "Infant", "Child", "Adolescent", "Adult", "Elderly"], "description": "Patient age group." },
112
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "Country where event occurred." }
113
+ },
114
+ "required": []
115
+ },
116
+ "fields": {
117
+ "search_fields": {
118
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
119
+ "patient.patientsex": ["patient.patientsex"],
120
+ "patient.patientagegroup": ["patient.patientagegroup"],
121
+ "occurcountry": ["occurcountry"]
122
+ },
123
+ "return_fields": ["serious"],
124
+ "return_fields_mapping": {
125
+ "serious": {
126
+ "1": "Serious",
127
+ "2": "Non-serious"
128
+ }
129
+ }
130
+ }
131
+ },
132
+ {
133
+ "type": "FDADrugAdverseEventTool",
134
+ "name": "FAERS_count_outcomes_by_drug_event",
135
+ "description": "Count the outcome of adverse reactions (recovered, recovering, fatal, unresolved) filtered by drug, seriousness, and demographics. Data source: FDA Adverse Event Reporting System (FAERS).",
136
+ "parameter": {
137
+ "type": "object",
138
+ "properties": {
139
+ "medicinalproduct": { "type": "string", "description": "Drug name." },
140
+ "patient.patientsex": { "type": "string", "enum": [ "Male", "Female"] },
141
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate", "Infant", "Child", "Adolescent", "Adult", "Elderly"] },
142
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$" }
143
+ },
144
+ "required": ["medicinalproduct"]
145
+ },
146
+ "fields": {
147
+ "search_fields": {
148
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
149
+ "patient.patientsex": ["patient.patientsex"],
150
+ "patient.patientagegroup": ["patient.patientagegroup"],
151
+ "occurcountry": ["occurcountry"]
152
+ },
153
+ "return_fields": ["patient.reaction.reactionoutcome"],
154
+ "return_fields_mapping": {
155
+ "patient.reaction.reactionoutcome": {
156
+ "1": "Recovered/resolved",
157
+ "2": "Recovering/resolving",
158
+ "3": "Not recovered/not resolved",
159
+ "4": "Recovered/resolved with sequelae (consequent health issues)",
160
+ "5": "Fatal",
161
+ "6": "Unknown"
162
+ }
163
+ }
164
+ }
165
+ },
166
+ {
167
+ "type": "FDADrugAdverseEventTool",
168
+ "name": "FAERS_count_drug_routes_by_event",
169
+ "description": "Count the most common routes of administration for drugs involved in adverse event reports. Data source: FDA Adverse Event Reporting System (FAERS).",
170
+ "parameter": {
171
+ "type": "object",
172
+ "properties": {
173
+ "medicinalproduct": { "type": "string", "description": "Drug name." },
174
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Seriousness of event." }
175
+ },
176
+ "required": ["medicinalproduct"]
177
+ },
178
+ "fields": {
179
+ "search_fields": {
180
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
181
+ "serious": ["serious"]
182
+ },
183
+ "return_fields": ["patient.drug.drugadministrationroute.exact"],
184
+ "return_fields_mapping": {
185
+ "patient.drug.drugadministrationroute.exact": {
186
+ "001": "Auricular (otic)",
187
+ "002": "Buccal",
188
+ "003": "Cutaneous",
189
+ "004": "Dental",
190
+ "005": "Endocervical",
191
+ "006": "Endosinusial",
192
+ "007": "Endotracheal",
193
+ "008": "Epidural",
194
+ "009": "Extra-amniotic",
195
+ "010": "Hemodialysis",
196
+ "011": "Intra corpus cavernosum",
197
+ "012": "Intra-amniotic",
198
+ "013": "Intra-arterial",
199
+ "014": "Intra-articular",
200
+ "015": "Intra-uterine",
201
+ "016": "Intracardiac",
202
+ "017": "Intracavernous",
203
+ "018": "Intracerebral",
204
+ "019": "Intracervical",
205
+ "020": "Intracisternal",
206
+ "021": "Intracorneal",
207
+ "022": "Intracoronary",
208
+ "023": "Intradermal",
209
+ "024": "Intradiscal (intraspinal)",
210
+ "025": "Intrahepatic",
211
+ "026": "Intralesional",
212
+ "027": "Intralymphatic",
213
+ "028": "Intramedullar (bone marrow)",
214
+ "029": "Intrameningeal",
215
+ "030": "Intramuscular",
216
+ "031": "Intraocular",
217
+ "032": "Intrapericardial",
218
+ "033": "Intraperitoneal",
219
+ "034": "Intrapleural",
220
+ "035": "Intrasynovial",
221
+ "036": "Intratumor",
222
+ "037": "Intrathecal",
223
+ "038": "Intrathoracic",
224
+ "039": "Intratracheal",
225
+ "040": "Intravenous bolus",
226
+ "041": "Intravenous drip",
227
+ "042": "Intravenous (not otherwise specified)",
228
+ "043": "Intravesical",
229
+ "044": "Iontophoresis",
230
+ "045": "Nasal",
231
+ "046": "Occlusive dressing technique",
232
+ "047": "Ophthalmic",
233
+ "048": "Oral",
234
+ "049": "Oropharingeal",
235
+ "050": "Other",
236
+ "051": "Parenteral",
237
+ "052": "Periarticular",
238
+ "053": "Perineural",
239
+ "054": "Rectal",
240
+ "055": "Respiratory (inhalation)",
241
+ "056": "Retrobulbar",
242
+ "057": "Sunconjunctival",
243
+ "058": "Subcutaneous",
244
+ "059": "Subdermal",
245
+ "060": "Sublingual",
246
+ "061": "Topical",
247
+ "062": "Transdermal",
248
+ "063": "Transmammary",
249
+ "064": "Transplacental",
250
+ "065": "Unknown",
251
+ "066": "Urethral",
252
+ "067": "Vaginal"
253
+ }
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "type": "FDADrugAdverseEventTool",
259
+ "name": "FAERS_count_patient_age_distribution",
260
+ "description": "Analyze the age distribution of patients experiencing adverse events for a specific drug. The age groups are: Neonate (0-28 days), Infant (29 days - 23 months), Child (2-11 years), Adolescent (12-17 years), Adult (18-64 years), Elderly (65+ years). Data source: FDA Adverse Event Reporting System (FAERS).",
261
+ "parameter": {
262
+ "type": "object",
263
+ "properties": {
264
+ "medicinalproduct": { "type": "string", "description": "Drug name." }
265
+ },
266
+ "required": ["medicinalproduct"]
267
+ },
268
+ "fields": {
269
+ "search_fields": {
270
+ "medicinalproduct": ["patient.drug.medicinalproduct"]
271
+ },
272
+ "return_fields": ["patient.patientagegroup"],
273
+ "return_fields_mapping": {
274
+ "patient.patientagegroup": {
275
+ "1": "Neonate",
276
+ "2": "Infant",
277
+ "3": "Child",
278
+ "4": "Adolescent",
279
+ "5": "Adult",
280
+ "6": "Elderly"
281
+ }
282
+ }
283
+ }
284
+ },
285
+ {
286
+ "type": "FDADrugAdverseEventTool",
287
+ "name": "FAERS_count_death_related_by_drug",
288
+ "description": "Count adverse events associated with patient death for a given drug. Data source: FDA Adverse Event Reporting System (FAERS).",
289
+ "parameter": {
290
+ "type": "object",
291
+ "properties": {
292
+ "medicinalproduct": { "type": "string", "description": "Drug name." }
293
+ },
294
+ "required": ["medicinalproduct"]
295
+ },
296
+ "fields": {
297
+ "search_fields": {
298
+ "medicinalproduct": ["patient.drug.medicinalproduct"],
299
+ "seriousnessdeath": ["seriousnessdeath"]
300
+ },
301
+ "return_fields": ["seriousnessdeath"],
302
+ "return_fields_mapping": {
303
+ "seriousnessdeath": {
304
+ "1": "death",
305
+ "2": "alive"
306
+ }
307
+ }
308
+ }
309
+ },
310
+ {
311
+ "type": "FDACountAdditiveReactionsTool",
312
+ "name": "FAERS_count_additive_adverse_reactions",
313
+ "description": "Additive multi-drug data: Aggregate adverse reaction counts across specified medicinal products, stratified by demographics, seriousness, and outcomes. Data source: FDA Adverse Event Reporting System (FAERS).",
314
+ "parameter": {
315
+ "type": "object",
316
+ "properties": {
317
+ "medicinalproducts": { "type": "array", "items": { "type": "string" }, "description": "Array of medicinal product names." },
318
+ "patient.patientsex": { "type": "string", "enum": ["Male","Female"], "description": "Filter by patient sex." },
319
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate","Infant","Child","Adolescent","Adult","Elderly"], "description": "Filter by patient age group." },
320
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "Filter by ISO2 country code of occurrence." },
321
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Filter by seriousness classification." },
322
+ "seriousnessdeath": { "type": "string", "enum": ["Yes","No"], "description": "Filter for fatal outcomes." }
323
+ },
324
+ "required": ["medicinalproducts"]
325
+ },
326
+ "fields": {
327
+ "search_fields": {
328
+ "medicinalproducts": ["patient.drug.medicinalproduct"],
329
+ "patient.patientsex": ["patient.patientsex"],
330
+ "patient.patientagegroup": ["patient.patientagegroup"],
331
+ "occurcountry": ["occurcountry"],
332
+ "serious": ["serious"],
333
+ "seriousnessdeath": ["seriousnessdeath"]
334
+ },
335
+ "return_fields": ["patient.reaction.reactionmeddrapt.exact"]
336
+ }
337
+ },
338
+ {
339
+ "type": "FDACountAdditiveReactionsTool",
340
+ "name": "FAERS_count_additive_event_reports_by_country",
341
+ "description": "Additive multi-drug data: Aggregate report counts by country of occurrence across specified medicinal products. Data source: FDA Adverse Event Reporting System (FAERS).",
342
+ "parameter": {
343
+ "type": "object",
344
+ "properties": {
345
+ "medicinalproducts": { "type": "array", "items": { "type": "string" }, "description": "Array of medicinal product names." },
346
+ "patient.patientsex": { "type": "string", "enum": ["Male","Female"], "description": "Filter by sex." },
347
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate","Infant","Child","Adolescent","Adult","Elderly"], "description": "Filter by age group." },
348
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Filter by seriousness." }
349
+ },
350
+ "required": ["medicinalproducts"]
351
+ },
352
+ "fields": {
353
+ "search_fields": {
354
+ "medicinalproducts": ["patient.drug.medicinalproduct"],
355
+ "patient.patientsex": ["patient.patientsex"],
356
+ "patient.patientagegroup": ["patient.patientagegroup"],
357
+ "serious": ["serious"]
358
+ },
359
+ "return_fields": ["occurcountry.exact"]
360
+ }
361
+ },
362
+ {
363
+ "type": "FDACountAdditiveReactionsTool",
364
+ "name": "FAERS_count_additive_reports_by_reporter_country",
365
+ "description": "Additive multi-drug data: Aggregate adverse event reports by primary reporter country across medicinal products. Data source: FDA Adverse Event Reporting System (FAERS).",
366
+ "parameter": {
367
+ "type": "object",
368
+ "properties": {
369
+ "medicinalproducts": { "type": "array", "items": { "type": "string" }, "description": "Array of medicinal product names." },
370
+ "patient.patientsex": { "type": "string", "enum": ["Male","Female"], "description": "Filter by sex." },
371
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate","Infant","Child","Adolescent","Adult","Elderly"], "description": "Filter by age group." },
372
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Filter by seriousness." }
373
+ },
374
+ "required": ["medicinalproducts"]
375
+ },
376
+ "fields": {
377
+ "search_fields": {
378
+ "medicinalproducts": ["patient.drug.medicinalproduct"],
379
+ "patient.patientsex": ["patient.patientsex"],
380
+ "patient.patientagegroup": ["patient.patientagegroup"],
381
+ "serious": ["serious"]
382
+ },
383
+ "return_fields": ["primarysource.reportercountry.exact"]
384
+ }
385
+ },
386
+ {
387
+ "type": "FDACountAdditiveReactionsTool",
388
+ "name": "FAERS_count_additive_seriousness_classification",
389
+ "description": "Additive multi-drug data: Quantify serious vs non-serious classifications across medicinal products, annotated per regulatory definitions. Data source: FDA Adverse Event Reporting System (FAERS).",
390
+ "parameter": {
391
+ "type": "object",
392
+ "properties": {
393
+ "medicinalproducts": { "type": "array", "items": { "type": "string" }, "description": "Array of medicinal product names." },
394
+ "patient.patientsex": { "type": "string", "enum": ["Male","Female"], "description": "Filter by sex." },
395
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate","Infant","Child","Adolescent","Adult","Elderly"], "description": "Filter by age group." },
396
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$", "description": "ISO2 country code filter." }
397
+ },
398
+ "required": ["medicinalproducts"]
399
+ },
400
+ "fields": {
401
+ "search_fields": {
402
+ "medicinalproducts": ["patient.drug.medicinalproduct"],
403
+ "patient.patientsex": ["patient.patientsex"],
404
+ "patient.patientagegroup": ["patient.patientagegroup"],
405
+ "occurcountry": ["occurcountry"]
406
+ },
407
+ "return_fields": ["serious"],
408
+ "return_fields_mapping": { "serious": { "1": "Serious", "2": "Non-serious" } }
409
+ }
410
+ },
411
+ {
412
+ "type": "FDACountAdditiveReactionsTool",
413
+ "name": "FAERS_count_additive_reaction_outcomes",
414
+ "description": "Additive multi-drug data: Determine reaction outcome counts (e.g., recovered, resolving, fatal) across medicinal products using standardized outcome mappings. Data source: FDA Adverse Event Reporting System (FAERS).",
415
+ "parameter": {
416
+ "type": "object",
417
+ "properties": {
418
+ "medicinalproducts": { "type": "array", "items": { "type": "string" }, "description": "Array of medicinal product names." },
419
+ "patient.patientsex": { "type": "string", "enum": ["Male","Female"] },
420
+ "patient.patientagegroup": { "type": "string", "enum": ["Neonate","Infant","Child","Adolescent","Adult","Elderly"] },
421
+ "occurcountry": { "type": "string", "pattern": "^[A-Z]{2}$" }
422
+ },
423
+ "required": ["medicinalproducts"]
424
+ },
425
+ "fields": {
426
+ "search_fields": {
427
+ "medicinalproducts": ["patient.drug.medicinalproduct"],
428
+ "patient.patientsex": ["patient.patientsex"],
429
+ "patient.patientagegroup": ["patient.patientagegroup"],
430
+ "occurcountry": ["occurcountry"]
431
+ },
432
+ "return_fields": ["patient.reaction.reactionoutcome"],
433
+ "return_fields_mapping": {
434
+ "patient.reaction.reactionoutcome": {
435
+ "1": "Recovered/resolved",
436
+ "2": "Recovering/resolving",
437
+ "3": "Not recovered/not resolved",
438
+ "4": "Recovered/resolved with sequelae",
439
+ "5": "Fatal",
440
+ "6": "Unknown"
441
+ }
442
+ }
443
+ }
444
+ },
445
+ {
446
+ "type": "FDACountAdditiveReactionsTool",
447
+ "name": "FAERS_count_additive_administration_routes",
448
+ "description": "Additive multi-drug data: Enumerate and count administration routes for adverse events across specified medicinal products, using standardized route codes. Data source: FDA Adverse Event Reporting System (FAERS).",
449
+ "parameter": {
450
+ "type": "object",
451
+ "properties": {
452
+ "medicinalproducts": { "type": "array", "items": { "type": "string" }, "description": "Array of medicinal product names." },
453
+ "serious": { "type": "string", "enum": ["Yes","No"], "description": "Filter by seriousness." }
454
+ },
455
+ "required": ["medicinalproducts"]
456
+ },
457
+ "fields": {
458
+ "search_fields": {
459
+ "medicinalproducts": ["patient.drug.medicinalproduct"],
460
+ "serious": ["serious"]
461
+ },
462
+ "return_fields": ["patient.drug.drugadministrationroute.exact"],
463
+ "return_fields_mapping": {
464
+ "patient.drug.drugadministrationroute.exact": {
465
+ "001": "Auricular (otic)", "002": "Buccal", "003": "Cutaneous", "004": "Dental",
466
+ "005": "Endocervical", "006": "Endosinusial", "007": "Endotracheal", "008": "Epidural",
467
+ "009": "Extra-amniotic", "010": "Hemodialysis", "011": "Intra corpus cavernosum",
468
+ "012": "Intra-amniotic", "013": "Intra-arterial", "014": "Intra-articular",
469
+ "015": "Intra-uterine", "016": "Intracardiac", "017": "Intracavernous",
470
+ "018": "Intracerebral", "019": "Intracervical", "020": "Intracisternal",
471
+ "021": "Intracorneal", "022": "Intracoronary", "023": "Intradermal",
472
+ "024": "Intradiscal (intraspinal)", "025": "Intrahepatic", "026": "Intralesional",
473
+ "027": "Intralymphatic", "028": "Intramedullar (bone marrow)", "029": "Intrameningeal",
474
+ "030": "Intramuscular", "031": "Intraocular", "032": "Intrapericardial",
475
+ "033": "Intraperitoneal", "034": "Intrapleural", "035": "Intrasynovial",
476
+ "036": "Intratumor", "037": "Intrathecal", "038": "Intrathoracic",
477
+ "039": "Intratracheal", "040": "Intravenous bolus", "041": "Intravenous drip",
478
+ "042": "Intravenous (not otherwise specified)", "043": "Intravesical",
479
+ "044": "Iontophoresis", "045": "Nasal", "046": "Occlusive dressing technique",
480
+ "047": "Ophthalmic", "048": "Oral", "049": "Oropharingeal", "050": "Other",
481
+ "051": "Parenteral", "052": "Periarticular", "053": "Perineural",
482
+ "054": "Rectal", "055": "Respiratory (inhalation)", "056": "Retrobulbar",
483
+ "057": "Sunconjunctival", "058": "Subcutaneous", "059": "Subdermal",
484
+ "060": "Sublingual", "061": "Topical", "062": "Transdermal",
485
+ "063": "Transmammary", "064": "Transplacental", "065": "Unknown",
486
+ "066": "Urethral", "067": "Vaginal"
487
+ }
488
+ }
489
+ }
490
+ }
491
+ ]
tool_lists/fda_drug_labeling_tools.json ADDED
The diff for this file is too large to render. See raw diff
 
tool_lists/monarch_tools.json ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "get_joint_associated_diseases_by_HPO_ID_list",
4
+ "description": "Retrieve diseases associated with a list of phenotypes or symptoms by a list of HPO IDs.",
5
+ "parameter": {
6
+ "type": "object",
7
+ "properties": {
8
+ "HPO_ID_list": {
9
+ "type": "array",
10
+ "description": "List of phenotypes or symptoms",
11
+ "items": {
12
+ "type": "string",
13
+ "description": "The HPO ID of the phenotype or symptom.",
14
+ "required": true
15
+ },
16
+ "required": true
17
+ },
18
+ "limit": {
19
+ "type": "integer",
20
+ "description": "Number of entries to fetch.",
21
+ "required": false
22
+ },
23
+ "offset": {
24
+ "type": "integer",
25
+ "description": "Number of initial entries to skip.",
26
+ "required": false
27
+ }
28
+ }
29
+ },
30
+ "query_schema": {
31
+ "category": [
32
+ "biolink:DiseaseToPhenotypicFeatureAssociation"
33
+ ],
34
+ "object": null,
35
+ "compact": true,
36
+ "object_category": [
37
+ "biolink:PhenotypicFeature"
38
+ ],
39
+ "limit": 500,
40
+ "offset": 0
41
+ },
42
+ "label": [
43
+ "Monarch",
44
+ "Phenotype",
45
+ "Symptom",
46
+ "Disease",
47
+ "HPO_ID"
48
+ ],
49
+ "type": "MonarchDiseasesForMultiplePheno",
50
+ "tool_url": "/association"
51
+ },
52
+ {
53
+ "name": "get_phenotype_by_HPO_ID",
54
+ "description": "Retrieve a phenotype or symptom by its HPO ID.",
55
+ "parameter": {
56
+ "type": "object",
57
+ "properties": {
58
+ "id": {
59
+ "type": "string",
60
+ "description": "The HPO ID of the phenotype or symptom.",
61
+ "required": true
62
+ }
63
+ }
64
+ },
65
+ "query_schema": {
66
+ "id": null,
67
+ "url_key": "id"
68
+ },
69
+ "label": [
70
+ "Monarch",
71
+ "Phenotype",
72
+ "Symptom",
73
+ "HPO_ID"
74
+ ],
75
+ "type": "Monarch",
76
+ "tool_url": "/entity/{url_key}"
77
+ },
78
+ {
79
+ "name": "get_HPO_ID_by_phenotype",
80
+ "description": "Retrieve the HPO ID of a phenotype or symptom.",
81
+ "parameter": {
82
+ "type": "object",
83
+ "properties": {
84
+ "query": {
85
+ "type": "string",
86
+ "description": "One query phenotype or symptom.",
87
+ "required": true
88
+ },
89
+ "limit": {
90
+ "type": "integer",
91
+ "description": "Number of entries to fetch.",
92
+ "required": false
93
+ },
94
+ "offset": {
95
+ "type": "integer",
96
+ "description": "Number of initial entries to skip.",
97
+ "required": false
98
+ }
99
+ }
100
+ },
101
+ "query_schema": {
102
+ "query": null,
103
+ "category": [
104
+ "biolink:PhenotypicFeature"
105
+ ],
106
+ "limit": 20,
107
+ "offset": 0
108
+ },
109
+ "label": [
110
+ "Monarch",
111
+ "Phenotype",
112
+ "Symptom",
113
+ "HPO_ID"
114
+ ],
115
+ "type": "Monarch",
116
+ "tool_url": "/search"
117
+ }
118
+ ]
tool_lists/opentarget_tools.json ADDED
@@ -0,0 +1,1439 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "OpenTargets_get_associated_targets_by_disease_efoId",
4
+ "description": "Find targets associated with a specific disease or phenotype based on efoId.",
5
+ "label": [
6
+ "Disease",
7
+ "Phenotype",
8
+ "Target",
9
+ "Association",
10
+ "OpenTarget",
11
+ "GraphQL"
12
+ ],
13
+ "parameter": {
14
+ "type": "object",
15
+ "properties": {
16
+ "efoId": {
17
+ "type": "string",
18
+ "description": "The efoId of a disease or phenotype.",
19
+ "required": true
20
+ }
21
+ }
22
+ },
23
+ "query_schema": "\nquery associatedTargets($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n associatedTargets {\n count\n rows {\n target {\n id\n approvedSymbol\n }\n score\n }\n }\n }\n}\n",
24
+ "type": "OpenTarget"
25
+ },
26
+ {
27
+ "name": "OpenTargets_get_associated_diseases_phenotypes_by_target_ensemblID",
28
+ "description": "Find diseases or phenotypes associated with a specific target using ensemblId.",
29
+ "label": [
30
+ "Target",
31
+ "Disease",
32
+ "Phenotype",
33
+ "Association",
34
+ "OpenTarget",
35
+ "GraphQL"
36
+ ],
37
+ "parameter": {
38
+ "type": "object",
39
+ "properties": {
40
+ "ensemblId": {
41
+ "type": "string",
42
+ "description": "The ensemblId of a target.",
43
+ "required": true
44
+ }
45
+ }
46
+ },
47
+ "query_schema": "\nquery associatedDiseases($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n associatedDiseases {\n count\n rows {\n disease {\n id\n name\n }\n datasourceScores {\n id\n score\n }\n }\n }\n }\n}\n",
48
+ "type": "OpenTarget"
49
+ },
50
+ {
51
+ "name": "OpenTargets_target_disease_evidence",
52
+ "description": "Explore evidence that supports a specific target-disease association. Input is disease efoId and target ensemblID.",
53
+ "label": [
54
+ "Target",
55
+ "Disease",
56
+ "Evidence",
57
+ "Association",
58
+ "OpenTarget",
59
+ "GraphQL"
60
+ ],
61
+ "parameter": {
62
+ "type": "object",
63
+ "properties": {
64
+ "efoId": {
65
+ "type": "string",
66
+ "description": "The efoId of a disease or phenotype.",
67
+ "required": true
68
+ },
69
+ "ensemblId": {
70
+ "type": "string",
71
+ "description": "The ensemblId of a target.",
72
+ "required": true
73
+ }
74
+ }
75
+ },
76
+ "query_schema": "\nquery targetDiseaseEvidence($efoId: String!, $ensemblId: String!) {\n disease(efoId: $efoId) {\n id\n name\n evidences(datasourceIds: [\"intogen\"], ensemblIds: [$ensemblId]) {\n count\n rows {\n disease {\n id\n name\n }\n diseaseFromSource\n target {\n id\n approvedSymbol\n }\n mutatedSamples {\n functionalConsequence {\n id\n label\n }\n numberSamplesTested\n numberMutatedSamples\n }\n resourceScore\n significantDriverMethods\n cohortId\n cohortShortName\n cohortDescription\n }\n }\n }\n}\n",
77
+ "type": "OpenTarget"
78
+ },
79
+ {
80
+ "name": "OpenTargets_get_drug_warnings_by_chemblId",
81
+ "description": "Retrieve warnings for a specific drug using ChEMBL ID.",
82
+ "parameter": {
83
+ "type": "object",
84
+ "properties": {
85
+ "chemblId": {
86
+ "type": "string",
87
+ "description": "The ChEMBL ID of the drug.",
88
+ "required": true
89
+ }
90
+ }
91
+ },
92
+ "query_schema": "\n query drugWarnings($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n drugWarnings {\n warningType\n description\n country\n year\n toxicityClass\n chemblIds\n efoIdForWarningClass\n references {\n id\n source\n url\n }\n }\n }\n }\n ",
93
+ "label": [
94
+ "Drug",
95
+ "AdverseEvents",
96
+ "SafetyLiability",
97
+ "OpenTarget",
98
+ "GraphQL",
99
+ "Warnings",
100
+ "Safety",
101
+ "Withdrawal",
102
+ "Toxicity"
103
+ ],
104
+ "type": "OpenTarget"
105
+ },
106
+ {
107
+ "name": "OpenTargets_get_drug_mechanisms_of_action_by_chemblId",
108
+ "description": "Retrieve the mechanisms of action associated with a specific drug using chemblId.",
109
+ "parameter": {
110
+ "type": "object",
111
+ "properties": {
112
+ "chemblId": {
113
+ "type": "string",
114
+ "description": "The ChEMBL ID of the drug.",
115
+ "required": true
116
+ }
117
+ }
118
+ },
119
+ "query_schema": "\n query drugMechanismsOfAction($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n mechanismsOfAction {\n rows {\n mechanismOfAction\n actionType\n targetName\n targets {\n id\n approvedSymbol\n }\n }\n }\n }\n }\n ",
120
+ "label": [
121
+ "Drug",
122
+ "MechanismsOfAction",
123
+ "Target",
124
+ "Pharmacology",
125
+ "ChemblId",
126
+ "OpenTarget",
127
+ "GraphQL"
128
+ ],
129
+ "type": "OpenTarget"
130
+ },
131
+ {
132
+ "name": "OpenTargets_get_associated_drugs_by_disease_efoId",
133
+ "description": "Retrieve known drugs associated with a specific disease by disease efoId.",
134
+ "parameter": {
135
+ "type": "object",
136
+ "properties": {
137
+ "efoId": {
138
+ "type": "string",
139
+ "description": "The EFO ID of the disease.",
140
+ "required": true
141
+ },
142
+ "size": {
143
+ "type": "integer",
144
+ "description": "Number of entries to fetch, recomanding a large number to avoid missing drugs.",
145
+ "required": true
146
+ }
147
+ }
148
+ },
149
+ "query_schema": "\n query diseaseKnownDrugs($efoId: String!, $size: Int!, $freeTextQuery: String) {\n disease(efoId: $efoId) {\n id\n name\n knownDrugs(size: $size, freeTextQuery: $freeTextQuery) {\n count\n rows {\n drug {\n id\n name\n tradeNames\n maximumClinicalTrialPhase\n isApproved\n hasBeenWithdrawn\n }\n phase\n status\n mechanismOfAction\n target {\n id\n approvedSymbol\n }\n }\n }\n }\n }\n ",
150
+ "label": [
151
+ "OpenTarget",
152
+ "Disease",
153
+ "Drug",
154
+ "Pagination",
155
+ "GraphQL"
156
+ ],
157
+ "type": "OpenTarget"
158
+ },
159
+ {
160
+ "name": "OpenTargets_get_similar_entities_by_disease_efoId",
161
+ "description": "Retrieve similar entities for a given disease efoId using a model trained with PubMed.",
162
+ "parameter": {
163
+ "type": "object",
164
+ "properties": {
165
+ "efoId": {
166
+ "type": "string",
167
+ "description": "The EFO ID of the disease.",
168
+ "required": true
169
+ },
170
+ "threshold": {
171
+ "type": "number",
172
+ "description": "Threshold similarity between 0 and 1. Only results above threshold are returned.",
173
+ "required": true
174
+ },
175
+ "size": {
176
+ "type": "integer",
177
+ "description": "Number of similar entities to fetch.",
178
+ "required": true
179
+ }
180
+ }
181
+ },
182
+ "query_schema": "\n query diseaseSimilarEntities($efoId: String!, $threshold: Float!, $size: Int!) {\n disease(efoId: $efoId) {\n id\n name\n similarEntities(threshold: $threshold, size: $size) {\n id\n category\n score\n object {\n ... on Disease {\n id\n name\n }\n ... on Target {\n id\n approvedSymbol\n }\n ... on Drug {\n id\n name\n }\n }\n }\n }\n }\n ",
183
+ "label": [
184
+ "Disease",
185
+ "Similarity",
186
+ "Model",
187
+ "Entities",
188
+ "OpenTarget",
189
+ "GraphQL"
190
+ ],
191
+ "type": "OpenTarget"
192
+ },
193
+ {
194
+ "name": "OpenTargets_get_similar_entities_by_drug_chemblId",
195
+ "description": "Retrieve similar entities for a given drug chemblId using a model trained with PubMed.",
196
+ "parameter": {
197
+ "type": "object",
198
+ "properties": {
199
+ "chemblId": {
200
+ "type": "string",
201
+ "description": "The chemblId of the disease.",
202
+ "required": true
203
+ },
204
+ "threshold": {
205
+ "type": "number",
206
+ "description": "Threshold similarity between 0 and 1. Only results above threshold are returned.",
207
+ "required": true
208
+ },
209
+ "size": {
210
+ "type": "integer",
211
+ "description": "Number of similar entities to fetch.",
212
+ "required": true
213
+ }
214
+ }
215
+ },
216
+ "query_schema": "\n query diseaseSimilarEntities($chemblId: String!, $threshold: Float!, $size: Int!) {\n drug(chemblId: $chemblId) {\n id\n name\n similarEntities(threshold: $threshold, size: $size) {\n id\n category\n score\n object {\n ... on Disease {\n id\n name\n }\n ... on Target {\n id\n approvedSymbol\n }\n ... on Drug {\n id\n name\n }\n }\n }\n }\n }\n ",
217
+ "label": [
218
+ "Drug",
219
+ "Similarity",
220
+ "Model",
221
+ "Entities",
222
+ "OpenTarget",
223
+ "GraphQL"
224
+ ],
225
+ "type": "OpenTarget"
226
+ },
227
+ {
228
+ "name": "OpenTargets_get_similar_entities_by_target_ensemblID",
229
+ "description": "Retrieve similar entities for a given target ensemblID using a model trained with PubMed.",
230
+ "parameter": {
231
+ "type": "object",
232
+ "properties": {
233
+ "ensemblId": {
234
+ "type": "string",
235
+ "description": "The ensemblID of the disease.",
236
+ "required": true
237
+ },
238
+ "threshold": {
239
+ "type": "number",
240
+ "description": "Threshold similarity between 0 and 1. Only results above threshold are returned.",
241
+ "required": true
242
+ },
243
+ "size": {
244
+ "type": "integer",
245
+ "description": "Number of similar entities to fetch.",
246
+ "required": true
247
+ }
248
+ }
249
+ },
250
+ "query_schema": "\n query diseaseSimilarEntities($ensemblId: String!, $threshold: Float!, $size: Int!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n similarEntities(threshold: $threshold, size: $size) {\n id\n category\n score\n object {\n ... on Disease {\n id\n name\n }\n ... on Target {\n id\n approvedSymbol\n }\n ... on Drug {\n id\n name\n }\n }\n }\n }\n }\n ",
251
+ "label": [
252
+ "Disease",
253
+ "Similarity",
254
+ "Model",
255
+ "Entities",
256
+ "OpenTarget",
257
+ "GraphQL"
258
+ ],
259
+ "type": "OpenTarget"
260
+ },
261
+ {
262
+ "name": "OpenTargets_get_associated_phenotypes_by_disease_efoId",
263
+ "description": "Find HPO phenotypes asosciated with the specified disease efoId.",
264
+ "parameter": {
265
+ "type": "object",
266
+ "properties": {
267
+ "efoId": {
268
+ "type": "string",
269
+ "description": "The efoId of a disease or phenotype.",
270
+ "required": true
271
+ }
272
+ }
273
+ },
274
+ "query_schema": "query diseaseAnnotation($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n phenotypes {\n rows {\n phenotypeHPO {\n id\n name\n description\n namespace\n }\n phenotypeEFO {\n id\n name\n }\n }\n }\n }\n}",
275
+ "label": [
276
+ "Disease",
277
+ "OpenTarget",
278
+ "GraphQL",
279
+ "Phenotype",
280
+ "Symptoms",
281
+ "Clinical signs"
282
+ ],
283
+ "type": "OpenTarget"
284
+ },
285
+ {
286
+ "name": "OpenTargets_get_drug_withdrawn_blackbox_status_by_chemblId",
287
+ "description": "Find withdrawn and black-box warning statuses for a specific drug by chemblId.",
288
+ "parameter": {
289
+ "type": "object",
290
+ "properties": {
291
+ "chemblId": {
292
+ "type": "array",
293
+ "items": {
294
+ "type": "string"
295
+ },
296
+ "description": "The chemblId of a drug.",
297
+ "required": true
298
+ }
299
+ }
300
+ },
301
+ "query_schema": "\n query drugWithdrawnWarningData($chemblId: String!) {\n drug(chemblId: $chemblId) {\n name\n id\n hasBeenWithdrawn\n blackBoxWarning\n }\n }\n ",
302
+ "label": [
303
+ "Drug",
304
+ "SafetyWarnings",
305
+ "Withdrawal",
306
+ "OpenTarget",
307
+ "GraphQL"
308
+ ],
309
+ "type": "OpenTarget"
310
+ },
311
+ {
312
+ "name": "OpenTargets_search_category_counts_by_query_string",
313
+ "description": "Get the count of entries in each entity category (disease, target, drug) based on a query string.",
314
+ "parameter": {
315
+ "type": "object",
316
+ "properties": {
317
+ "queryString": {
318
+ "type": "string",
319
+ "description": "The search string for querying information.",
320
+ "required": true
321
+ }
322
+ }
323
+ },
324
+ "query_schema": "\n query searchCategoryCounts($queryString: String!) {\n search(queryString: $queryString) {\n aggregations {\n total\n entities {\n total\n name\n }\n }\n }\n }\n ",
325
+ "label": [
326
+ "OpenTarget",
327
+ "GraphQL",
328
+ "SearchResults",
329
+ "Search",
330
+ "Query",
331
+ "Counts",
332
+ "Categories"
333
+ ],
334
+ "type": "OpenTarget"
335
+ },
336
+ {
337
+ "name": "OpenTargets_get_disease_id_description_by_name",
338
+ "description": "Retrieve the efoId and additional details of a disease based on its name.",
339
+ "parameter": {
340
+ "type": "object",
341
+ "properties": {
342
+ "diseaseName": {
343
+ "type": "string",
344
+ "description": "The name of the disease to search for.",
345
+ "required": true
346
+ }
347
+ }
348
+ },
349
+ "query_schema": "\n query getDiseaseIdByName($diseaseName: String!) {\n search(queryString: $diseaseName, entityNames: [\"disease\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
350
+ "label": [
351
+ "Disease",
352
+ "Identification",
353
+ "Search",
354
+ "Name",
355
+ "Disease",
356
+ "OpenTarget",
357
+ "GraphQL"
358
+ ],
359
+ "type": "OpenTarget"
360
+ },
361
+ {
362
+ "name": "OpenTargets_get_drug_id_description_by_name",
363
+ "description": "Fetch the drug chemblId and description based on the drug generic name.",
364
+ "parameter": {
365
+ "type": "object",
366
+ "properties": {
367
+ "drugName": {
368
+ "type": "string",
369
+ "description": "The name of the drug for which the ID is required.",
370
+ "required": true
371
+ }
372
+ }
373
+ },
374
+ "query_schema": "\n query getDrugIdByName($drugName: String!) {\n search(queryString: $drugName, entityNames: [\"drug\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
375
+ "label": [
376
+ "Identification",
377
+ "Search",
378
+ "Name",
379
+ "Drug",
380
+ "OpenTarget",
381
+ "GraphQL"
382
+ ],
383
+ "type": "OpentargetToolDrugNameMatch"
384
+ },
385
+ {
386
+ "name": "OpenTargets_get_drug_chembId_by_generic_name",
387
+ "description": "Fetch the drug chemblId and description based on the drug generic name.",
388
+ "parameter": {
389
+ "type": "object",
390
+ "properties": {
391
+ "drugName": {
392
+ "type": "string",
393
+ "description": "The generic name of the drug for which the ID is required.",
394
+ "required": true
395
+ }
396
+ }
397
+ },
398
+ "query_schema": "\n query getDrugIdByName($drugName: String!) {\n search(queryString: $drugName, entityNames: [\"drug\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
399
+ "label": [
400
+ "Identification",
401
+ "Search",
402
+ "Name",
403
+ "Drug",
404
+ "OpenTarget",
405
+ "GraphQL"
406
+ ],
407
+ "type": "OpentargetToolDrugNameMatch"
408
+ },
409
+ {
410
+ "name": "OpenTargets_get_drug_indications_by_chemblId",
411
+ "description": "Fetch indications (treatable phenotypes/diseases) for a given drug chemblId.",
412
+ "parameter": {
413
+ "type": "object",
414
+ "properties": {
415
+ "chemblId": {
416
+ "type": "string",
417
+ "description": "The chemblId of the drug for which to retrieve treatable phenotypes information.",
418
+ "required": true
419
+ }
420
+ }
421
+ },
422
+ "query_schema": "\n query drugIndications($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n indications {\n rows {\n disease {\n id\n name\n }\n maxPhaseForIndication\n references {\n source\n }\n }\n }\n }\n }\n ",
423
+ "label": [
424
+ "Drug",
425
+ "Indications",
426
+ "Disease",
427
+ "Treatment",
428
+ "OpenTarget",
429
+ "GraphQL"
430
+ ],
431
+ "type": "OpenTarget"
432
+ },
433
+ {
434
+ "name": "OpenTargets_get_target_gene_ontology_by_ensemblID",
435
+ "description": "Retrieve Gene Ontology annotations for a specific target by Ensembl ID.",
436
+ "parameter": {
437
+ "type": "object",
438
+ "properties": {
439
+ "ensemblId": {
440
+ "type": "string",
441
+ "description": "The Ensembl ID of the target for which to retrieve Gene Ontology annotations.",
442
+ "required": true
443
+ }
444
+ }
445
+ },
446
+ "query_schema": "\n query targetGeneOntology($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n geneOntology {\n aspect\n evidence\n geneProduct\n source\n term {\n id\n name\n }\n }\n }\n }\n ",
447
+ "label": [
448
+ "Target",
449
+ "GeneOntology",
450
+ "OpenTarget",
451
+ "GraphQL"
452
+ ],
453
+ "type": "OpenTarget"
454
+ },
455
+ {
456
+ "name": "OpenTargets_get_target_homologues_by_ensemblID",
457
+ "description": "Fetch homologues for a specific target by Ensembl ID.",
458
+ "parameter": {
459
+ "type": "object",
460
+ "properties": {
461
+ "ensemblId": {
462
+ "type": "string",
463
+ "description": "The Ensembl ID of the target for which to retrieve homologues.",
464
+ "required": true
465
+ }
466
+ }
467
+ },
468
+ "query_schema": "\n query targetHomologues($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n homologues {\n homologyType\n queryPercentageIdentity\n speciesId\n speciesName\n targetGeneId\n targetGeneSymbol\n targetPercentageIdentity\n isHighConfidence\n }\n }\n }\n ",
469
+ "label": [
470
+ "OpenTarget",
471
+ "Target Information",
472
+ "GraphQL",
473
+ "Homologue"
474
+ ],
475
+ "type": "OpenTarget"
476
+ },
477
+ {
478
+ "name": "OpenTargets_get_target_safety_profile_by_ensemblID",
479
+ "description": "Retrieve known target safety liabilities for a specific target Ensembl ID.",
480
+ "parameter": {
481
+ "type": "object",
482
+ "properties": {
483
+ "ensemblId": {
484
+ "type": "string",
485
+ "description": "The Ensembl ID of the target for which to retrieve safety liabilities.",
486
+ "required": true
487
+ }
488
+ }
489
+ },
490
+ "query_schema": "\n query targetSafetyLiabilities($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n safetyLiabilities {\n event\n eventId\n biosamples {\n cellFormat\n cellLabel\n tissueLabel\n tissueId\n }\n effects {\n dosing\n direction\n }\n studies {\n name\n type\n description\n }\n datasource\n literature\n }\n }\n }\n ",
491
+ "label": [
492
+ "Target",
493
+ "SafetyLiability",
494
+ "OpenTarget",
495
+ "GraphQL",
496
+ "Safety",
497
+ "Liabilities"
498
+ ],
499
+ "type": "OpenTarget"
500
+ },
501
+ {
502
+ "name": "OpenTargets_get_biological_mouse_models_by_ensemblID",
503
+ "description": "Retrieve biological mouse models, including allelic compositions and genetic backgrounds, for a specific target.",
504
+ "parameter": {
505
+ "type": "object",
506
+ "properties": {
507
+ "ensemblId": {
508
+ "type": "string",
509
+ "description": "The Ensembl ID of the target.",
510
+ "required": true
511
+ }
512
+ }
513
+ },
514
+ "query_schema": "\n query fetchBiologicalModels($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n mousePhenotypes {\n biologicalModels {\n allelicComposition\n geneticBackground\n id\n literature\n }\n }\n }\n }\n ",
515
+ "label": [
516
+ "OpenTarget",
517
+ "Target Information",
518
+ "BiologicalModels",
519
+ "GraphQL"
520
+ ],
521
+ "type": "OpenTarget"
522
+ },
523
+ {
524
+ "name": "OpenTargets_get_target_genomic_location_by_ensemblID",
525
+ "description": "Retrieve genomic location data for a specific target, including chromosome, start, end, and strand.",
526
+ "parameter": {
527
+ "type": "object",
528
+ "properties": {
529
+ "ensemblId": {
530
+ "type": "string",
531
+ "description": "The Ensembl ID of the target for which to retrieve genomic location information.",
532
+ "required": true
533
+ }
534
+ }
535
+ },
536
+ "query_schema": "\n query targetGenomicLocation($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n genomicLocation {\n chromosome\n start\n end\n strand\n }\n }\n }\n ",
537
+ "label": [
538
+ "Target",
539
+ "GenomicLocation",
540
+ "OpenTarget",
541
+ "GraphQL"
542
+ ],
543
+ "type": "OpenTarget"
544
+ },
545
+ {
546
+ "name": "OpenTargets_get_target_subcellular_locations_by_ensemblID",
547
+ "description": "Retrieve information about subcellular locations for a specific target ensemblID.",
548
+ "parameter": {
549
+ "type": "object",
550
+ "properties": {
551
+ "ensemblId": {
552
+ "type": "string",
553
+ "description": "The ensemblId of a target.",
554
+ "required": true
555
+ }
556
+ }
557
+ },
558
+ "query_schema": "\n query targetSubcellularLocations($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n subcellularLocations {\n location\n source\n termSL\n labelSL\n }\n }\n }\n ",
559
+ "label": [
560
+ "Target",
561
+ "Subcellular Locations",
562
+ "GraphQL",
563
+ "OpenTarget"
564
+ ],
565
+ "type": "OpenTarget"
566
+ },
567
+ {
568
+ "name": "OpenTargets_get_target_synonyms_by_ensemblID",
569
+ "description": "Retrieve synonyms for specified target, including alternative names and symbols, using given ensemblID.",
570
+ "parameter": {
571
+ "type": "object",
572
+ "properties": {
573
+ "ensemblId": {
574
+ "type": "string",
575
+ "description": "The Ensembl ID of the target.",
576
+ "required": true
577
+ }
578
+ }
579
+ },
580
+ "query_schema": "\n query retrieveTargetSynonyms($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n synonyms {\n label\n source\n }\n symbolSynonyms {\n label\n source\n }\n nameSynonyms {\n label\n source\n }\n }\n }\n ",
581
+ "label": [
582
+ "OpenTarget",
583
+ "Target Information",
584
+ "GraphQL",
585
+ "Target"
586
+ ],
587
+ "type": "OpenTarget"
588
+ },
589
+ {
590
+ "name": "OpenTargets_get_target_tractability_by_ensemblID",
591
+ "description": "Retrieve tractability assessments, including modality and values, for a specific target ensembl ID.",
592
+ "parameter": {
593
+ "type": "object",
594
+ "properties": {
595
+ "ensemblId": {
596
+ "type": "string",
597
+ "description": "The Ensembl ID of the target.",
598
+ "required": true
599
+ }
600
+ }
601
+ },
602
+ "query_schema": "\n query targetTractabilityAssessment($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n tractability {\n label\n modality\n value\n }\n }\n }\n ",
603
+ "label": [
604
+ "Target",
605
+ "Tractability",
606
+ "OpenTarget",
607
+ "Target Information",
608
+ "GraphQL"
609
+ ],
610
+ "type": "OpenTarget"
611
+ },
612
+ {
613
+ "name": "OpenTargets_get_target_classes_by_ensemblID",
614
+ "description": "Retrieve the target classes associated with a specific target ensemblID.",
615
+ "parameter": {
616
+ "type": "object",
617
+ "properties": {
618
+ "ensemblId": {
619
+ "type": "string",
620
+ "description": "The Ensembl ID of the target.",
621
+ "required": true
622
+ }
623
+ }
624
+ },
625
+ "query_schema": "\n query fetchTargetClasses($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n targetClass {\n id\n label\n level\n }\n }\n }\n ",
626
+ "label": [
627
+ "OpenTarget",
628
+ "Target Information",
629
+ "GraphQL",
630
+ "Target"
631
+ ],
632
+ "type": "OpenTarget"
633
+ },
634
+ {
635
+ "name": "OpenTargets_get_target_enabling_packages_by_ensemblID",
636
+ "description": "Retrieve the Target Enabling Packages (TEP) associated with a specific target ensemblID.",
637
+ "parameter": {
638
+ "type": "object",
639
+ "properties": {
640
+ "ensemblId": {
641
+ "type": "string",
642
+ "description": "The Ensembl ID of the target.",
643
+ "required": true
644
+ }
645
+ }
646
+ },
647
+ "query_schema": "\n query fetchTargetEnablingPackages($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n tep {\n name\n uri\n therapeuticArea\n description\n }\n }\n }\n ",
648
+ "label": [
649
+ "OpenTarget",
650
+ "Target Information",
651
+ "GraphQL",
652
+ "Target"
653
+ ],
654
+ "type": "OpenTarget"
655
+ },
656
+ {
657
+ "name": "OpenTargets_get_target_interactions_by_ensemblID",
658
+ "description": "Retrieve interaction data for a specific target ensemblID, including interaction partners and evidence.",
659
+ "label": [
660
+ "Target",
661
+ "Interaction",
662
+ "Evidence",
663
+ "GraphQL",
664
+ "Pagination",
665
+ "OpenTarget"
666
+ ],
667
+ "parameter": {
668
+ "type": "object",
669
+ "properties": {
670
+ "ensemblId": {
671
+ "type": "string",
672
+ "description": "The Ensembl ID of the target.",
673
+ "required": true
674
+ },
675
+ "page": {
676
+ "type": "object",
677
+ "properties": {
678
+ "index": {
679
+ "type": "integer",
680
+ "description": "The index of the page to retrieve.",
681
+ "required": true
682
+ },
683
+ "size": {
684
+ "type": "integer",
685
+ "description": "The number of items per page.",
686
+ "required": true
687
+ }
688
+ },
689
+ "description": "Pagination parameters.",
690
+ "required": false
691
+ }
692
+ }
693
+ },
694
+ "query_schema": "\n query targetInteractions($ensemblId: String!, $page: Pagination) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n interactions(page: $page) {\n count\n rows {\n intA\n targetA {\n id\n approvedSymbol\n }\n intB\n targetB {\n id\n approvedSymbol\n }\n score\n sourceDatabase\n evidences {\n evidenceScore\n pubmedId\n interactionDetectionMethodShortName\n }\n }\n }\n }\n }\n ",
695
+ "type": "OpenTarget"
696
+ },
697
+ {
698
+ "name": "OpenTargets_get_disease_ancestors_parents_by_efoId",
699
+ "description": "Retrieve the disease ancestors and parents in the ontology using the disease EFO ID.",
700
+ "parameter": {
701
+ "type": "object",
702
+ "properties": {
703
+ "efoId": {
704
+ "type": "string",
705
+ "description": "The EFO ID of the disease.",
706
+ "required": true
707
+ }
708
+ }
709
+ },
710
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n ancestors\n parents {\n id\n name\n }\n }\n }\n ",
711
+ "label": [
712
+ "OpenTarget",
713
+ "Disease",
714
+ "Disease Information",
715
+ "GraphQL"
716
+ ],
717
+ "type": "OpenTarget"
718
+ },
719
+ {
720
+ "name": "OpenTargets_get_disease_descendants_children_by_efoId",
721
+ "description": "Retrieve the disease descendants and children in the ontology using the disease EFO ID.",
722
+ "parameter": {
723
+ "type": "object",
724
+ "properties": {
725
+ "efoId": {
726
+ "type": "string",
727
+ "description": "The EFO ID of the disease.",
728
+ "required": true
729
+ }
730
+ }
731
+ },
732
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n descendants\n children {\n id\n name\n }\n }\n }\n",
733
+ "label": [
734
+ "OpenTarget",
735
+ "Disease",
736
+ "Disease Information",
737
+ "GraphQL"
738
+ ],
739
+ "type": "OpenTarget"
740
+ },
741
+ {
742
+ "name": "OpenTargets_get_disease_locations_by_efoId",
743
+ "description": "Retrieve the disease's direct location and indirect location disease terms and IDs using the disease EFO ID.",
744
+ "parameter": {
745
+ "type": "object",
746
+ "properties": {
747
+ "efoId": {
748
+ "type": "string",
749
+ "description": "The EFO ID of the disease.",
750
+ "required": true
751
+ }
752
+ }
753
+ },
754
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n directLocationIds\n indirectLocationIds\n directLocations {\n id\n name\n }\n indirectLocations {\n id\n name\n }\n }\n }\n ",
755
+ "label": [
756
+ "OpenTarget",
757
+ "Disease",
758
+ "Disease Information",
759
+ "GraphQL"
760
+ ],
761
+ "type": "OpenTarget"
762
+ },
763
+ {
764
+ "name": "OpenTargets_get_disease_synonyms_by_efoId",
765
+ "description": "Retrieve disease synonyms by its EFO ID.",
766
+ "parameter": {
767
+ "type": "object",
768
+ "properties": {
769
+ "efoId": {
770
+ "type": "string",
771
+ "description": "The EFO ID of the disease.",
772
+ "required": true
773
+ }
774
+ }
775
+ },
776
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n synonyms {\n relation\n terms\n }\n }\n }\n",
777
+ "label": [
778
+ "OpenTarget",
779
+ "Disease",
780
+ "Disease Information",
781
+ "GraphQL"
782
+ ],
783
+ "type": "OpenTarget"
784
+ },
785
+ {
786
+ "name": "OpenTargets_get_disease_description_by_efoId",
787
+ "description": "Retrieve disease description, name, database cros references, obsolete terms, and whether it's a therapeutic area, all using the specified efoId.",
788
+ "parameter": {
789
+ "type": "object",
790
+ "properties": {
791
+ "efoId": {
792
+ "type": "string",
793
+ "description": "The EFO ID of the disease.",
794
+ "required": true
795
+ }
796
+ }
797
+ },
798
+ "query_schema": "\n query getDiseaseDetailsByEfoId($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n description\n dbXRefs\n obsoleteTerms\n isTherapeuticArea\n }\n }\n ",
799
+ "label": [
800
+ "OpenTarget",
801
+ "Disease",
802
+ "Disease Information",
803
+ "GraphQL"
804
+ ],
805
+ "type": "OpenTarget"
806
+ },
807
+ {
808
+ "name": "OpenTargets_get_disease_therapeutic_areas_by_efoId",
809
+ "description": "Retrieve the therapeutic areas associated with a specific disease efoId.",
810
+ "parameter": {
811
+ "type": "object",
812
+ "properties": {
813
+ "efoId": {
814
+ "type": "string",
815
+ "description": "The EFO ID of the disease.",
816
+ "required": true
817
+ }
818
+ }
819
+ },
820
+ "query_schema": "\n query diseaseTherapeuticAreas($efoId: String!) {\n disease(efoId: $efoId) {\n id\n name\n therapeuticAreas {\n id\n name\n }\n }\n }\n ",
821
+ "label": [
822
+ "OpenTarget",
823
+ "Disease",
824
+ "TherapeuticArea",
825
+ "GraphQL"
826
+ ],
827
+ "type": "OpenTarget"
828
+ },
829
+ {
830
+ "name": "OpenTargets_get_drug_adverse_events_by_chemblId",
831
+ "description": "Retrieve significant adverse events reported for a specific drug chemblId.",
832
+ "parameter": {
833
+ "type": "object",
834
+ "properties": {
835
+ "chemblId": {
836
+ "type": "string",
837
+ "description": "The ChEMBL ID of the drug.",
838
+ "required": true
839
+ },
840
+ "page": {
841
+ "type": "object",
842
+ "properties": {
843
+ "index": {
844
+ "type": "integer",
845
+ "description": "Index of the page to fetch, starting from 0.",
846
+ "required": true
847
+ },
848
+ "size": {
849
+ "type": "integer",
850
+ "description": "Number of entries per page.",
851
+ "required": true
852
+ }
853
+ },
854
+ "description": "Pagination settings.",
855
+ "required": false
856
+ }
857
+ }
858
+ },
859
+ "query_schema": "\n query drugAdverseEvents($chemblId: String!, $page: Pagination) {\n drug(chemblId: $chemblId) {\n id\n name\n adverseEvents(page: $page) {\n count\n criticalValue\n rows {\n name\n meddraCode\n count\n logLR\n }\n }\n }\n }\n ",
860
+ "label": [
861
+ "Drug",
862
+ "AdverseEvents",
863
+ "Safety",
864
+ "Reporting",
865
+ "Pagination",
866
+ "OpenTarget",
867
+ "GraphQL",
868
+ "AdverseEvents"
869
+ ],
870
+ "type": "OpenTarget"
871
+ },
872
+ {
873
+ "name": "OpenTargets_get_known_drugs_by_drug_chemblId",
874
+ "description": "Get a list of known drugs and associated information using the specified chemblId.",
875
+ "parameter": {
876
+ "type": "object",
877
+ "properties": {
878
+ "chemblId": {
879
+ "type": "string",
880
+ "description": "The ChEMBL ID of the drug.",
881
+ "required": true
882
+ }
883
+ }
884
+ },
885
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n knownDrugs {\n uniqueDrugs\n uniqueDiseases\n uniqueTargets\n count\n cursor\n rows {\n approvedSymbol\n approvedName\n label\n prefName\n drugType\n targetId\n diseaseId\n drugId\n phase\n mechanismOfAction\n status\n targetClass\n references {\n source\n ids\n urls\n }\n ctIds\n urls {\n url\n name\n }\n disease {\n id\n name\n }\n target {\n id\n approvedSymbol\n }\n drug {\n id\n name\n }\n }\n }\n }\n }\n ",
886
+ "label": [
887
+ "OpenTarget",
888
+ "Drug",
889
+ "Drug Information",
890
+ "GraphQL"
891
+ ],
892
+ "type": "OpenTarget"
893
+ },
894
+ {
895
+ "name": "OpenTargets_get_parent_child_molecules_by_drug_chembl_ID",
896
+ "description": "Get parent and child molecules of specified drug chemblId.",
897
+ "parameter": {
898
+ "type": "object",
899
+ "properties": {
900
+ "chemblId": {
901
+ "type": "string",
902
+ "description": "The ChEMBL ID of the drug.",
903
+ "required": true
904
+ }
905
+ }
906
+ },
907
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n parentMolecule {\n id\n name\n }\n childMolecules {\n id\n name\n }\n }\n }\n ",
908
+ "label": [
909
+ "OpenTarget",
910
+ "Drug",
911
+ "Drug Information",
912
+ "GraphQL"
913
+ ],
914
+ "type": "OpenTarget"
915
+ },
916
+ {
917
+ "name": "OpenTargets_get_approved_indications_by_drug_chemblId",
918
+ "description": "Retrieve detailed information about multiple drugs using a list of ChEMBL IDs.",
919
+ "parameter": {
920
+ "type": "object",
921
+ "properties": {
922
+ "chemblId": {
923
+ "type": "string",
924
+ "description": "The ChEMBL ID of the drug.",
925
+ "required": true
926
+ }
927
+ }
928
+ },
929
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n approvedIndications\n }\n }\n ",
930
+ "label": [
931
+ "OpenTarget",
932
+ "Drug",
933
+ "Drug Information",
934
+ "GraphQL"
935
+ ],
936
+ "type": "OpenTarget"
937
+ },
938
+ {
939
+ "name": "OpenTargets_get_drug_description_by_chemblId",
940
+ "description": "Get drug name, year of first approval, type, cross references, and max clinical trial phase based on specified chemblId.",
941
+ "parameter": {
942
+ "type": "object",
943
+ "properties": {
944
+ "chemblId": {
945
+ "type": "string",
946
+ "description": "The ChEMBL ID of the drug.",
947
+ "required": true
948
+ }
949
+ }
950
+ },
951
+ "query_schema": "\n query retrieveMultipleDrugsInfo($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n yearOfFirstApproval\n drugType\n crossReferences {\n source\n reference\n }\n maximumClinicalTrialPhase\n }\n }\n ",
952
+ "label": [
953
+ "OpenTarget",
954
+ "Drug",
955
+ "Drug Information",
956
+ "GraphQL"
957
+ ],
958
+ "type": "OpenTarget"
959
+ },
960
+ {
961
+ "name": "OpenTargets_get_drug_synonyms_by_chemblId",
962
+ "description": "Retrieve the synonyms associated with a specific drug chemblId.",
963
+ "parameter": {
964
+ "type": "object",
965
+ "properties": {
966
+ "chemblId": {
967
+ "type": "string",
968
+ "description": "The ChEMBL ID of the drug.",
969
+ "required": true
970
+ }
971
+ }
972
+ },
973
+ "query_schema": "\n query drugSynonyms($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n synonyms\n }\n }\n ",
974
+ "label": [
975
+ "OpenTarget",
976
+ "Drug Information",
977
+ "Drug",
978
+ "GraphQL"
979
+ ],
980
+ "type": "OpenTarget"
981
+ },
982
+ {
983
+ "name": "OpenTargets_get_drug_trade_names_by_chemblId",
984
+ "description": "Retrieve the trade names associated with a specific drug chemblId.",
985
+ "parameter": {
986
+ "type": "object",
987
+ "properties": {
988
+ "chemblId": {
989
+ "type": "string",
990
+ "description": "The ChEMBL ID of the drug.",
991
+ "required": true
992
+ }
993
+ }
994
+ },
995
+ "query_schema": "\n query drugTradeNames($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n tradeNames\n }\n }\n ",
996
+ "label": [
997
+ "Drug",
998
+ "OpenTarget",
999
+ "Drug Information",
1000
+ "GraphQL"
1001
+ ],
1002
+ "type": "OpenTarget"
1003
+ },
1004
+ {
1005
+ "name": "OpenTargets_get_drug_approval_status_by_chemblId",
1006
+ "description": "Retrieve the approval status of a specific drug chemblId.",
1007
+ "parameter": {
1008
+ "type": "object",
1009
+ "properties": {
1010
+ "chemblId": {
1011
+ "type": "string",
1012
+ "description": "The ChEMBL ID of the drug.",
1013
+ "required": true
1014
+ }
1015
+ }
1016
+ },
1017
+ "query_schema": "\n query drugApprovalStatus($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n isApproved\n }\n }\n ",
1018
+ "label": [
1019
+ "Drug",
1020
+ "Drug Information",
1021
+ "GraphQL",
1022
+ "OpenTarget"
1023
+ ],
1024
+ "type": "OpenTarget"
1025
+ },
1026
+ {
1027
+ "name": "OpenTargets_get_chemical_probes_by_target_ensemblID",
1028
+ "description": "Retrieve chemical probes associated with a specific target using its ensemblID.",
1029
+ "parameter": {
1030
+ "type": "object",
1031
+ "properties": {
1032
+ "ensemblId": {
1033
+ "type": "string",
1034
+ "description": "The Ensembl ID of the target for which to retrieve chemical probes.",
1035
+ "required": true
1036
+ }
1037
+ }
1038
+ },
1039
+ "query_schema": "\n query getTargetChemicalProbes($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n chemicalProbes {\n id\n control\n drugId\n mechanismOfAction\n isHighQuality\n origin\n probeMinerScore\n probesDrugsScore\n scoreInCells\n scoreInOrganisms\n targetFromSourceId\n urls {\n niceName\n url\n }\n }\n }\n }\n ",
1040
+ "label": [
1041
+ "OpenTarget",
1042
+ "Drug Information",
1043
+ "ChemicalProbe",
1044
+ "GraphQL"
1045
+ ],
1046
+ "type": "OpenTarget"
1047
+ },
1048
+ {
1049
+ "name": "OpenTargets_drug_pharmacogenomics_data",
1050
+ "description": "Retrieve pharmacogenomics data for a specific drug, including evidence levels and genotype annotations.",
1051
+ "label": [
1052
+ "Drug",
1053
+ "Pharmacogenomics",
1054
+ "Evidence",
1055
+ "Genotype",
1056
+ "Pagination",
1057
+ "OpenTarget",
1058
+ "GraphQL"
1059
+ ],
1060
+ "parameter": {
1061
+ "type": "object",
1062
+ "properties": {
1063
+ "chemblId": {
1064
+ "type": "string",
1065
+ "description": "The ChEMBL ID of the drug.",
1066
+ "required": true
1067
+ },
1068
+ "page": {
1069
+ "type": "object",
1070
+ "description": "Pagination options.",
1071
+ "properties": {
1072
+ "index": {
1073
+ "type": "integer",
1074
+ "description": "Pagination index.",
1075
+ "required": true
1076
+ },
1077
+ "size": {
1078
+ "type": "integer",
1079
+ "description": "Number of records to fetch per page.",
1080
+ "required": true
1081
+ }
1082
+ },
1083
+ "required": false
1084
+ }
1085
+ }
1086
+ },
1087
+ "query_schema": "\n query drugPharmacogenomicsData($chemblId: String!, $page: Pagination) {\n drug(chemblId: $chemblId) {\n id\n name\n pharmacogenomics(page: $page) {\n datasourceId\n datatypeId\n genotype\n evidenceLevel\n genotypeAnnotationText\n genotypeId\n haplotypeFromSourceId\n haplotypeId\n literature\n pgxCategory\n phenotypeFromSourceId\n phenotypeText\n studyId\n targetFromSourceId\n variantFunctionalConsequenceId\n variantRsId\n isDirectTarget\n variantFunctionalConsequence {\n id\n label\n }\n drugs {\n drugId\n drug {\n name\n }\n }\n target {\n id\n approvedSymbol\n }\n }\n }\n }\n ",
1088
+ "type": "OpenTarget"
1089
+ },
1090
+ {
1091
+ "name": "OpenTargets_get_associated_drugs_by_target_ensemblID",
1092
+ "description": "Get known drugs and information (e.g. id, name, MoA) associated with a specific target ensemblID, including clinical trial phase and mechanism of action of the drugs.",
1093
+ "parameter": {
1094
+ "type": "object",
1095
+ "properties": {
1096
+ "ensemblId": {
1097
+ "type": "string",
1098
+ "description": "The Ensembl ID of the target.",
1099
+ "required": true
1100
+ },
1101
+ "size": {
1102
+ "type": "integer",
1103
+ "description": "Number of entries to fetch.",
1104
+ "required": true
1105
+ },
1106
+ "cursor": {
1107
+ "type": "string",
1108
+ "description": "Cursor for pagination.",
1109
+ "required": false
1110
+ }
1111
+ }
1112
+ },
1113
+ "query_schema": "\n query targetKnownDrugs($ensemblId: String!, $size: Int!, $cursor: String) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n knownDrugs(size: $size, cursor: $cursor) {\n count\n rows {\n drug {\n id\n name\n tradeNames\n maximumClinicalTrialPhase\n isApproved\n hasBeenWithdrawn\n }\n phase\n status\n mechanismOfAction\n disease {\n id\n name\n }\n }\n }\n }\n }\n ",
1114
+ "label": [
1115
+ "Target",
1116
+ "Drug",
1117
+ "MechanismsOfAction",
1118
+ "Pagination",
1119
+ "OpenTarget",
1120
+ "GraphQL"
1121
+ ],
1122
+ "type": "OpenTarget"
1123
+ },
1124
+ {
1125
+ "name": "OpenTargets_get_associated_diseases_by_drug_chemblId",
1126
+ "description": "Retrieve the list of diseases associated with a specific drug chemblId based on clinical trial data or post-marketed drugs.",
1127
+ "parameter": {
1128
+ "type": "object",
1129
+ "properties": {
1130
+ "chemblId": {
1131
+ "type": "string",
1132
+ "description": "The ChEMBL ID of the drug.",
1133
+ "required": true
1134
+ }
1135
+ }
1136
+ },
1137
+ "query_schema": "\n query fetchLinkedDiseasesForDrug($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n linkedDiseases {\n count\n rows {\n id\n name\n description\n }\n }\n }\n }\n ",
1138
+ "label": [
1139
+ "Drug",
1140
+ "Disease",
1141
+ "OpenTarget",
1142
+ "Drug Information",
1143
+ "GraphQL"
1144
+ ],
1145
+ "type": "OpenTarget"
1146
+ },
1147
+ {
1148
+ "name": "OpenTargets_get_associated_targets_by_drug_chemblId",
1149
+ "description": "Retrieve the list of targets linked to a specific drug chemblId based on its mechanism of action.",
1150
+ "parameter": {
1151
+ "type": "object",
1152
+ "properties": {
1153
+ "chemblId": {
1154
+ "type": "string",
1155
+ "description": "The ChEMBL ID of the drug.",
1156
+ "required": true
1157
+ }
1158
+ }
1159
+ },
1160
+ "query_schema": "\n query fetchLinkedTargetsForDrug($chemblId: String!) {\n drug(chemblId: $chemblId) {\n id\n name\n linkedTargets {\n count\n rows {\n id\n approvedSymbol\n approvedName\n }\n }\n }\n }\n ",
1161
+ "label": [
1162
+ "Drug",
1163
+ "Target",
1164
+ "MechanismsOfAction",
1165
+ "OpenTarget",
1166
+ "GraphQL"
1167
+ ],
1168
+ "type": "OpenTarget"
1169
+ },
1170
+ {
1171
+ "name": "OpenTargets_multi_entity_search_by_query_string",
1172
+ "description": "Perform a multi-entity search based on a query string, filtering by entity names and pagination settings.",
1173
+ "parameter": {
1174
+ "type": "object",
1175
+ "properties": {
1176
+ "queryString": {
1177
+ "type": "string",
1178
+ "description": "The search string for querying information.",
1179
+ "required": true
1180
+ },
1181
+ "entityNames": {
1182
+ "type": "array",
1183
+ "items": {
1184
+ "type": "string"
1185
+ },
1186
+ "description": "List of entity names to search for (e.g., target, disease, drug).",
1187
+ "required": false
1188
+ },
1189
+ "page": {
1190
+ "type": "object",
1191
+ "properties": {
1192
+ "index": {
1193
+ "type": "integer",
1194
+ "description": "Pagination index.",
1195
+ "required": "True"
1196
+ },
1197
+ "size": {
1198
+ "type": "integer",
1199
+ "description": "Pagination size.",
1200
+ "required": "True"
1201
+ }
1202
+ },
1203
+ "description": "Pagination settings with index and size.",
1204
+ "required": false
1205
+ }
1206
+ }
1207
+ },
1208
+ "query_schema": "\n query multiEntitySearch($queryString: String!, $entityNames: [String!], $page: Pagination) {\n search(queryString: $queryString, entityNames: $entityNames, page: $page) {\n total\n hits {\n id\n entity\n description\n name\n score\n }\n }\n }\n ",
1209
+ "label": [
1210
+ "Search and Mapping Functions",
1211
+ "MultiEntitySearch",
1212
+ "Pagination",
1213
+ "OpenTarget",
1214
+ "GraphQL"
1215
+ ],
1216
+ "type": "OpenTarget"
1217
+ },
1218
+ {
1219
+ "name": "OpenTargets_get_gene_ontology_terms_by_goID",
1220
+ "description": "Retrieve Gene Ontology terms based on a list of GO IDs.",
1221
+ "parameter": {
1222
+ "type": "object",
1223
+ "properties": {
1224
+ "goIds": {
1225
+ "type": "array",
1226
+ "items": {
1227
+ "type": "string"
1228
+ },
1229
+ "description": "A list of Gene Ontology (GO) IDs to fetch the corresponding terms.",
1230
+ "required": true
1231
+ }
1232
+ }
1233
+ },
1234
+ "query_schema": "\n query fetchGeneOntologyTerms($goIds: [String!]!) {\n geneOntologyTerms(goIds: $goIds) {\n id\n name\n }\n }\n ",
1235
+ "label": [
1236
+ "GeneOntology",
1237
+ "Data Retrieval and Aggregation",
1238
+ "OpenTarget",
1239
+ "GraphQL"
1240
+ ],
1241
+ "type": "OpenTarget"
1242
+ },
1243
+ {
1244
+ "name": "OpenTargets_get_target_constraint_info_by_ensemblID",
1245
+ "description": "Retrieve genetic constraint information for a specific target ensemblID, including expected and observed values, and scores.",
1246
+ "parameter": {
1247
+ "type": "object",
1248
+ "properties": {
1249
+ "ensemblId": {
1250
+ "type": "string",
1251
+ "description": "The Ensembl ID of the target.",
1252
+ "required": true
1253
+ }
1254
+ }
1255
+ },
1256
+ "query_schema": "\n query targetConstraintInfo($ensemblId: String!) {\n target(ensemblId: $ensemblId) {\n id\n approvedSymbol\n geneticConstraint {\n constraintType\n exp\n obs\n oe\n oeLower\n oeUpper\n score\n upperBin\n upperBin6\n upperRank\n }\n }\n }\n ",
1257
+ "label": [
1258
+ "Target",
1259
+ "Constraint",
1260
+ "Data Retrieval and Aggregation",
1261
+ "OpenTarget",
1262
+ "GraphQL"
1263
+ ],
1264
+ "type": "OpenTarget"
1265
+ },
1266
+ {
1267
+ "name": "OpenTargets_get_publications_by_disease_efoId",
1268
+ "description": "Retrieve publications related to a disease efoId, including PubMed IDs and publication dates.",
1269
+ "parameter": {
1270
+ "type": "object",
1271
+ "properties": {
1272
+ "entityId": {
1273
+ "type": "string",
1274
+ "description": "The ID of the entity (efoId).",
1275
+ "required": true
1276
+ },
1277
+ "additionalIds": {
1278
+ "type": "array",
1279
+ "items": {
1280
+ "type": "string"
1281
+ },
1282
+ "description": "List of additional IDs to include in the search.",
1283
+ "required": false
1284
+ },
1285
+ "startYear": {
1286
+ "type": "integer",
1287
+ "description": "Year at the lower end of the filter.",
1288
+ "required": false
1289
+ },
1290
+ "startMonth": {
1291
+ "type": "integer",
1292
+ "description": "Month at the lower end of the filter.",
1293
+ "required": false
1294
+ },
1295
+ "endYear": {
1296
+ "type": "integer",
1297
+ "description": "Year at the higher end of the filter.",
1298
+ "required": false
1299
+ },
1300
+ "endMonth": {
1301
+ "type": "integer",
1302
+ "description": "Month at the higher end of the filter.",
1303
+ "required": false
1304
+ }
1305
+ }
1306
+ },
1307
+ "query_schema": "\n query entityPublications($entityId: String!, $additionalIds: [String!], $startYear: Int, $startMonth: Int, $endYear: Int, $endMonth: Int) {\n disease(efoId: $entityId) {\n id\n name\n literatureOcurrences(additionalIds: $additionalIds, startYear: $startYear, startMonth: $startMonth, endYear: $endYear, endMonth: $endMonth) {\n count\n filteredCount\n earliestPubYear\n rows {\n pmid\n pmcid\n publicationDate\n sentences {\n section\n matches {\n mappedId\n matchedLabel\n sectionStart\n sectionEnd\n startInSentence\n endInSentence\n matchedType\n }\n }\n }\n }\n }\n }\n ",
1308
+ "label": [
1309
+ "Publications",
1310
+ "Data Retrieval and Aggregation",
1311
+ "GraphQL",
1312
+ "OpenTarget"
1313
+ ],
1314
+ "type": "OpenTarget"
1315
+ },
1316
+ {
1317
+ "name": "OpenTargets_get_publications_by_target_ensemblID",
1318
+ "description": "Retrieve publications related to a target ensemblID, including PubMed IDs and publication dates.",
1319
+ "parameter": {
1320
+ "type": "object",
1321
+ "properties": {
1322
+ "entityId": {
1323
+ "type": "string",
1324
+ "description": "The ID of the entity (ensemblID).",
1325
+ "required": true
1326
+ },
1327
+ "additionalIds": {
1328
+ "type": "array",
1329
+ "items": {
1330
+ "type": "string"
1331
+ },
1332
+ "description": "List of additional IDs to include in the search.",
1333
+ "required": false
1334
+ },
1335
+ "startYear": {
1336
+ "type": "integer",
1337
+ "description": "Year at the lower end of the filter.",
1338
+ "required": false
1339
+ },
1340
+ "startMonth": {
1341
+ "type": "integer",
1342
+ "description": "Month at the lower end of the filter.",
1343
+ "required": false
1344
+ },
1345
+ "endYear": {
1346
+ "type": "integer",
1347
+ "description": "Year at the higher end of the filter.",
1348
+ "required": false
1349
+ },
1350
+ "endMonth": {
1351
+ "type": "integer",
1352
+ "description": "Month at the higher end of the filter.",
1353
+ "required": false
1354
+ }
1355
+ }
1356
+ },
1357
+ "query_schema": "\n query entityPublications($entityId: String!, $additionalIds: [String!], $startYear: Int, $startMonth: Int, $endYear: Int, $endMonth: Int) {\n target(ensemblId: $entityId) {\n id\n approvedSymbol\n literatureOcurrences(additionalIds: $additionalIds, startYear: $startYear, startMonth: $startMonth, endYear: $endYear, endMonth: $endMonth) {\n count\n filteredCount\n earliestPubYear\n rows {\n pmid\n pmcid\n publicationDate\n sentences {\n section\n matches {\n mappedId\n matchedLabel\n sectionStart\n sectionEnd\n startInSentence\n endInSentence\n matchedType\n }\n }\n }\n }\n }\n }\n ",
1358
+ "label": [
1359
+ "Publications",
1360
+ "Data Retrieval and Aggregation",
1361
+ "GraphQL",
1362
+ "OpenTarget"
1363
+ ],
1364
+ "type": "OpenTarget"
1365
+ },
1366
+ {
1367
+ "name": "OpenTargets_get_publications_by_drug_chemblId",
1368
+ "description": "Retrieve publications related to a drug chemblId, including PubMed IDs and publication dates.",
1369
+ "parameter": {
1370
+ "type": "object",
1371
+ "properties": {
1372
+ "entityId": {
1373
+ "type": "string",
1374
+ "description": "The ID of the entity (chemblId).",
1375
+ "required": true
1376
+ },
1377
+ "additionalIds": {
1378
+ "type": "array",
1379
+ "items": {
1380
+ "type": "string"
1381
+ },
1382
+ "description": "List of additional IDs to include in the search.",
1383
+ "required": false
1384
+ },
1385
+ "startYear": {
1386
+ "type": "integer",
1387
+ "description": "Year at the lower end of the filter.",
1388
+ "required": false
1389
+ },
1390
+ "startMonth": {
1391
+ "type": "integer",
1392
+ "description": "Month at the lower end of the filter.",
1393
+ "required": false
1394
+ },
1395
+ "endYear": {
1396
+ "type": "integer",
1397
+ "description": "Year at the higher end of the filter.",
1398
+ "required": false
1399
+ },
1400
+ "endMonth": {
1401
+ "type": "integer",
1402
+ "description": "Month at the higher end of the filter.",
1403
+ "required": false
1404
+ }
1405
+ }
1406
+ },
1407
+ "query_schema": "\n query entityPublications($entityId: String!, $additionalIds: [String!], $startYear: Int, $startMonth: Int, $endYear: Int, $endMonth: Int) {\n drug(chemblId: $entityId) {\n id\n name\n literatureOcurrences(additionalIds: $additionalIds, startYear: $startYear, startMonth: $startMonth, endYear: $endYear, endMonth: $endMonth) {\n count\n filteredCount\n earliestPubYear\n rows {\n pmid\n pmcid\n publicationDate\n sentences {\n section\n matches {\n mappedId\n matchedLabel\n sectionStart\n sectionEnd\n startInSentence\n endInSentence\n matchedType\n }\n }\n }\n }\n }\n }\n ",
1408
+ "label": [
1409
+ "Publications",
1410
+ "Data Retrieval and Aggregation",
1411
+ "GraphQL",
1412
+ "OpenTarget"
1413
+ ],
1414
+ "type": "OpenTarget"
1415
+ },
1416
+ {
1417
+ "name": "OpenTargets_get_target_id_description_by_name",
1418
+ "description": "Get the ensemblId and description based on the target name.",
1419
+ "parameter": {
1420
+ "type": "object",
1421
+ "properties": {
1422
+ "targetName": {
1423
+ "type": "string",
1424
+ "description": "The name of the target for which the ID is required.",
1425
+ "required": true
1426
+ }
1427
+ }
1428
+ },
1429
+ "query_schema": "\n query getTargetIdByName($targetName: String!) {\n search(queryString: $targetName, entityNames: [\"target\"]) {\n hits {\n id\n name\n description\n }\n }\n }\n ",
1430
+ "label": [
1431
+ "Search",
1432
+ "Name",
1433
+ "Target",
1434
+ "OpenTarget",
1435
+ "GraphQL"
1436
+ ],
1437
+ "type": "OpenTarget"
1438
+ }
1439
+ ]
tool_lists/pubtator_tools.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "PubTatorTool",
4
+ "name": "PubTator3_EntityAutocomplete",
5
+ "description": "Provides suggestions for the best‐matching standardized PubTator IDs for a partial biomedical term (gene, disease, chemical, or variant). Use this tool first to convert free‐text names into the stable @IDs required by the other PubTator APIs.",
6
+ "endpoint_path": "/entity/autocomplete/",
7
+ "method": "GET",
8
+ "param_map": {
9
+ "text": "query",
10
+ "entity_type": "concept",
11
+ "max_results": "limit"
12
+ },
13
+ "parameter": {
14
+ "type": "object",
15
+ "properties": {
16
+ "text": {
17
+ "type": "string",
18
+ "description": "A few characters or the full name of the biomedical concept you are trying to look up (e.g. “BRAF V6”)."
19
+ },
20
+ "entity_type": {
21
+ "type": "string",
22
+ "description": "Optional filter to restrict suggestions to a single category such as GENE, DISEASE, CHEMICAL, or VARIANT."
23
+ },
24
+ "max_results": {
25
+ "type": "integer",
26
+ "description": "Maximum number of suggestions to return (1 - 50, default = 10)."
27
+ }
28
+ },
29
+ "required": ["text"]
30
+ },
31
+ "fields": {
32
+ "tool_subtype": "PubTatorEntity"
33
+ }
34
+ },
35
+ {
36
+ "type": "PubTatorTool",
37
+ "name": "PubTator3_LiteratureSearch",
38
+ "description": "Find PubMed articles that match a keyword, a PubTator entity ID (e.g. “@GENE_BRAF”), or an entity-to-entity relation expression (e.g. “relations:treat|@CHEMICAL_Doxorubicin|@DISEASE_Neoplasms”).",
39
+ "endpoint_path": "/search/",
40
+ "method": "GET",
41
+ "param_map": {
42
+ "query": "text",
43
+ "page": "page",
44
+ "page_size": "page_size"
45
+ },
46
+ "parameter": {
47
+ "type": "object",
48
+ "properties": {
49
+ "query": {
50
+ "type": "string",
51
+ "description": "What you want to search for. This can be plain keywords, a single PubTator ID, or the special relation syntax shown above."
52
+ },
53
+ "page": {
54
+ "type": "integer",
55
+ "description": "Zero-based results page (optional; default = 0)."
56
+ },
57
+ "page_size": {
58
+ "type": "integer",
59
+ "description": "How many PMIDs to return per page (optional; default = 20, maximum = 200)."
60
+ }
61
+ },
62
+ "required": ["query"]
63
+ },
64
+ "fields": {
65
+ "tool_subtype": "PubTatorSearch"
66
+ }
67
+ }
68
+ ]
tool_lists/semantic_scholar_tools.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "SemanticScholarTool",
4
+ "name": "SemanticScholar_search_papers",
5
+ "description": "Search for papers on Semantic Scholar including abstracts. This tool queries the Semantic Scholar API using natural language keywords and returns papers with details such as title, abstract, publication year, journal (venue), and URL.",
6
+ "parameter": {
7
+ "type": "object",
8
+ "properties": {
9
+ "query": {
10
+ "type": "string",
11
+ "description": "Search query for Semantic Scholar. Use keywords separated by spaces to refine the search."
12
+ },
13
+ "limit": {
14
+ "type": "integer",
15
+ "description": "Maximum number of papers to return from Semantic Scholar.",
16
+ "default": 5
17
+ },
18
+ "api_key": {
19
+ "type": "string",
20
+ "description": "Optional API key for Semantic Scholar to obtain a higher quota."
21
+ }
22
+ },
23
+ "required": ["query"]
24
+ }
25
+ }
26
+ ]
tool_lists/special_tools.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "Finish",
4
+ "description": "Indicate the end of multi-step reasoning.",
5
+ "parameter": {
6
+ "type": "object",
7
+ "properties": null
8
+ }
9
+ },
10
+ {
11
+ "name": "Tool_RAG",
12
+ "description": "Retrieve related tools from the toolbox based on the provided description",
13
+ "parameter": {
14
+ "type": "object",
15
+ "properties": {
16
+ "description": {
17
+ "type": "string",
18
+ "description": "The description of the tool capability required.",
19
+ "required": true
20
+ },
21
+ "limit": {
22
+ "type": "integer",
23
+ "description": "The number of tools to retrieve",
24
+ "required": true
25
+ }
26
+ }
27
+ },
28
+ "required": [
29
+ "description",
30
+ "limit"
31
+ ]
32
+ },
33
+ {
34
+ "name": "CallAgent",
35
+ "description": "Give a solution plan to the agent and let it solve the problem. Solution plan should reflect a distinct method, approach, or viewpoint to solve the given question. Call these function multiple times, and each solution plan should start with different aspects of the question, for example, genes, phenotypes, diseases, or drugs, etc. The CallAgent will achieve the task based on the plan, so only give the plan instead of unverified information.",
36
+ "parameter": {
37
+ "type": "object",
38
+ "properties":
39
+ {
40
+ "solution": {
41
+ "type": "string",
42
+ "description": "A feasible and concise solution plan that address the question.",
43
+ "required": true
44
+ }
45
+ }
46
+ }
47
+ }
48
+ ]