Skip to main content
Glama

fetch_protein_info

Retrieve detailed metadata for a protein using its NCBI Protein ID, including gene data, sequence information, and related annotations, via the NCBI Gene MCP Server.

Instructions

Fetch detailed information for a specific protein ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protein_idYesNCBI Protein ID

Implementation Reference

  • Core handler implementing the tool logic: makes NCBI Entrez esummary request to 'protein' DB, parses response, and returns ProteinInfo model.
    def fetch_protein_info(self, protein_id: str) -> ProteinInfo: """ Fetch detailed information for a specific protein. Args: protein_id: NCBI Protein ID Returns: ProteinInfo object with protein details """ params = { "db": "protein", "id": protein_id } response = self._make_request("esummary", params) result = response.get("result", {}) protein_data = result.get(protein_id) if not protein_data: raise Exception(f"No data found for protein ID: {protein_id}") return ProteinInfo( protein_id=protein_id, title=protein_data.get("title", ""), organism=protein_data.get("organism", ""), length=protein_data.get("slen"), mol_type=protein_data.get("moltype") )
  • Tool registration in MCP tools/list handler, defining name, description, and input schema.
    { "name": "fetch_protein_info", "description": "Fetch detailed information for a specific protein ID", "inputSchema": { "type": "object", "properties": { "protein_id": { "type": "string", "description": "NCBI Protein ID" } }, "required": ["protein_id"] } },
  • Pydantic model defining the output structure for protein information.
    class ProteinInfo(BaseModel): """Model for protein information from NCBI Entrez.""" protein_id: str = Field(description="NCBI Protein ID") title: str = Field(description="Protein title") organism: str = Field(description="Organism scientific name") length: Optional[int] = Field(default=None, description="Protein sequence length") mol_type: Optional[str] = Field(default=None, description="Molecule type")
  • MCP server dispatching logic for the tool: validates input, calls bridge handler, formats JSON response for MCP protocol.
    elif name == "fetch_protein_info": protein_id = arguments.get("protein_id") if not protein_id: raise ValueError("protein_id is required") result = self.bridge.fetch_protein_info(protein_id) protein_json = result.model_dump_json(indent=2) self.send_response({ "content": [{ "type": "text", "text": f"Protein Information for ID {protein_id}:\n\n{protein_json}" }] })

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