Skip to main content
Glama

fetch_gene_info

Retrieve comprehensive details about a specific gene using its NCBI Gene ID, enabling accurate gene metadata and related information extraction for research and analysis.

Instructions

Fetch detailed information for a specific gene ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gene_idYesNCBI Gene ID (e.g., '672' for BRCA1)

Implementation Reference

  • MCP tool schema definition for fetch_gene_info, including input schema requiring 'gene_id' string
    { "name": "fetch_gene_info", "description": "Fetch detailed information for a specific gene ID", "inputSchema": { "type": "object", "properties": { "gene_id": { "type": "string", "description": "NCBI Gene ID (e.g., '672' for BRCA1)" } }, "required": ["gene_id"] } },
  • MCP server dispatch handler for the fetch_gene_info tool that extracts parameters, calls bridge implementation, formats JSON response, and sends MCP content response
    elif name == "fetch_gene_info": gene_id = arguments.get("gene_id") if not gene_id: raise ValueError("gene_id is required") result = self.bridge.fetch_gene_info(gene_id) gene_json = result.model_dump_json(indent=2) self.send_response({ "content": [{ "type": "text", "text": f"Gene Information for ID {gene_id}:\n\n{gene_json}" }] })
  • Core implementation of fetch_gene_info: makes NCBI Entrez esummary API request, parses response, extracts and formats gene information into GeneInfo model
    def fetch_gene_info(self, gene_id: str) -> GeneInfo: """ Fetch detailed information for a specific gene. Args: gene_id: NCBI Gene ID Returns: GeneInfo object with gene details """ params = { "db": "gene", "id": gene_id } response = self._make_request("esummary", params) result = response.get("result", {}) gene_data = result.get(gene_id) if not gene_data: raise Exception(f"No data found for gene ID: {gene_id}") # Extract organism information organism = gene_data.get("organism", {}) organism_name = organism.get("scientificname", "Unknown") if isinstance(organism, dict) else str(organism) # Extract other aliases other_aliases = [] if "otheraliases" in gene_data: aliases = gene_data["otheraliases"] if isinstance(aliases, str): other_aliases = [alias.strip() for alias in aliases.split(",")] elif isinstance(aliases, list): other_aliases = aliases return GeneInfo( gene_id=gene_id, name=gene_data.get("name", ""), description=gene_data.get("description", ""), organism=organism_name, chromosome=gene_data.get("chromosome"), map_location=gene_data.get("maplocation"), gene_type=gene_data.get("geneticsource"), other_aliases=other_aliases if other_aliases else None, summary=gene_data.get("summary") )

Other Tools

Related Tools

Latest Blog Posts

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/mohammadnajeeb/ncbi_gene_mcp_client'

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