Skip to main content
Glama

BioContextAI Knowledgebase MCP

Official

bc_query_open_targets_graphql

Execute GraphQL queries on the Open Targets API using Ensembl gene IDs or EFO disease IDs. Access data on targets, diseases, drugs, variants, and more. Ensure valid queries by first fetching schema or examples.

Instructions

Execute a GraphQL query against the Open Targets API after fetching the schema.

Important: Always first fetch examples using the schema using get_open_targets_query_examples. If the examples are not sufficient, also get the schema using the get_open_targets_graphql_schema tool before executing a query. Relying on either of these options provides the necessary context for the query and ensures that the query is valid.

Queries should use the Ensembl gene ID (e.g., "ENSG00000141510"). If necessary, first use get_ensembl_id_from_gene_symbol to convert gene symbols (e.g., "TP53") to Ensembl IDs.

If a disease ID is needed, use the get_efo_id_from_disease_name tool to get the EFO ID (e.g., "EFO_0004705") for a disease name (e.g., "Hypothyroidism").

Make sure to always start the query string with the keyword query followed by the query name. The query string should be a valid GraphQL query, and the variables should be a dictionary of parameters that the query requires.

Open Targets provides data on:

  • target: annotations, tractability, mouse models, expression, disease/phenotype associations, available drugs.
  • disease: annotations, ontology, drugs, symptoms, target associations.
  • drug: annotations, mechanisms, indications, pharmacovigilance.
  • variant: annotations, frequencies, effects, consequences, credible sets.
  • studies: annotations, traits, publications, cohorts, credible sets.
  • credibleSet: annotations, variant sets, gene assignments, colocalization.
  • search: index of all platform entities.

Args: query_string (str): The GraphQL query string. variables (dict): The variables for the GraphQL query.

Returns: dict: The response data from the GraphQL API.

Input Schema

NameRequiredDescriptionDefault
query_stringYesThe GraphQL query string
variablesNoThe variables for the GraphQL query

Input Schema (JSON Schema)

{ "properties": { "query_string": { "description": "The GraphQL query string", "title": "Query String", "type": "string" }, "variables": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "description": "The variables for the GraphQL query", "title": "Variables" } }, "required": [ "query_string" ], "type": "object" }
Install Server

Other Tools from BioContextAI Knowledgebase MCP

Related Tools

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/biocontext-ai/knowledgebase-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server