Skip to main content
Glama
mohammadnajeeb

NCBI Gene MCP Server

fetch_protein_info

Retrieve detailed protein information from NCBI using a protein ID to access metadata and biological data for research and analysis.

Instructions

Fetch detailed information for a specific protein ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
protein_idYesNCBI Protein ID

Implementation Reference

  • Core handler function that performs the NCBI esummary API call for protein database and constructs ProteinInfo object.
    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")
        )
  • Pydantic model defining the structure and validation for the protein information output.
    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 tool registration entry providing the tool 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"]
        }
    },
  • MCP server dispatch handler that extracts arguments, calls bridge, serializes to JSON, and sends response.
    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}"
            }]
        })
  • Input schema definition for the fetch_protein_info tool in MCP registration.
    "inputSchema": {
        "type": "object",
        "properties": {
            "protein_id": {
                "type": "string",
                "description": "NCBI Protein ID"
            }
        },
        "required": ["protein_id"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool fetches information, implying a read-only operation, but doesn't address key aspects like authentication needs, rate limits, error handling, or what 'detailed information' entails in the response. This leaves significant gaps for agent understanding.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool, though it could be slightly more informative to enhance clarity without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is minimal. It lacks context on what 'detailed information' includes, how results are structured, or any behavioral traits like data source or limitations, making it incomplete for reliable agent use despite the straightforward schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'protein_id' documented as 'NCBI Protein ID'. The description adds no additional parameter details beyond what the schema provides, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('fetch detailed information') and target resource ('for a specific protein ID'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'fetch_gene_info' or 'search_by_gene_symbol', which likely retrieve related but different biological data, so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'fetch_gene_info' or 'search_by_gene_symbol', nor does it mention prerequisites or exclusions. It implies usage for protein-specific queries but lacks explicit context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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