Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_interpro_entry

Retrieve detailed metadata for InterPro entries including family, domain, or functional site information from member databases like PFAM and PROSITE, with optional protein interactions, pathways, and cross-references.

Instructions

Get InterPro entry details (family, domain, or functional site). Returns metadata from member databases like PFAM, PROSITE.

Returns: dict: Entry metadata including name, type, description, member databases, optionally interactions/pathways/cross-references or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
interpro_idYesInterPro ID (e.g., 'IPR000001')
include_interactionsNoInclude protein-protein interactions data
include_pathwaysNoInclude pathway information
include_cross_referencesNoInclude cross-references to other databases

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function decorated with @core_mcp.tool() implementing the logic to fetch InterPro entry details from EBI API, including optional interactions, pathways, and cross-references. The tool is named 'get_interpro_entry' in core_mcp but prefixed to 'bc_get_interpro_entry' in the main server.
    @core_mcp.tool()
    def get_interpro_entry(
        interpro_id: Annotated[
            str,
            Field(description="InterPro ID (e.g., 'IPR000001')"),
        ],
        include_interactions: Annotated[
            bool,
            Field(description="Include protein-protein interactions data"),
        ] = False,
        include_pathways: Annotated[
            bool,
            Field(description="Include pathway information"),
        ] = False,
        include_cross_references: Annotated[
            bool,
            Field(description="Include cross-references to other databases"),
        ] = False,
    ) -> dict:
        """Get InterPro entry details (family, domain, or functional site). Returns metadata from member databases like PFAM, PROSITE.
    
        Returns:
            dict: Entry metadata including name, type, description, member databases, optionally interactions/pathways/cross-references or error message.
        """
        # Validate InterPro ID format
        interpro_id = interpro_id.upper().strip()
        if not interpro_id.startswith("IPR") or len(interpro_id) != 9:
            return {"error": "Invalid InterPro ID format. Expected format: IPR000001"}
    
        base_url = f"https://www.ebi.ac.uk/interpro/api/entry/interpro/{interpro_id}"
    
        # Build query parameters for additional data
        params = {}
        extra_fields = []
    
        if include_cross_references:
            extra_fields.append("cross_references")
    
        if extra_fields:
            params["extra_fields"] = ",".join(extra_fields)
    
        try:
            # Get basic entry information
            response = requests.get(base_url, params=params)
            response.raise_for_status()
    
            entry_data = response.json()
    
            if not entry_data.get("metadata"):
                return {"error": f"No data found for InterPro entry {interpro_id}"}
    
            result = entry_data["metadata"]
    
            # Optionally fetch interactions data
            if include_interactions:
                try:
                    interactions_url = f"{base_url}?interactions"
                    interactions_response = requests.get(interactions_url)
                    if interactions_response.status_code == 200:
                        interactions_data = interactions_response.json()
                        result["interactions"] = interactions_data.get("results", [])
                except Exception:
                    result["interactions"] = {"error": "Could not fetch interactions data"}
    
            # Optionally fetch pathways data
            if include_pathways:
                try:
                    pathways_url = f"{base_url}?pathways"
                    pathways_response = requests.get(pathways_url)
                    if pathways_response.status_code == 200:
                        pathways_data = pathways_response.json()
                        result["pathways"] = pathways_data.get("results", [])
                except Exception:
                    result["pathways"] = {"error": "Could not fetch pathways data"}
    
            return result
    
        except requests.exceptions.HTTPError as e:
            if e.response.status_code == 404:
                return {"error": f"InterPro entry {interpro_id} not found"}
            return {"error": f"HTTP error: {e}"}
        except Exception as e:
            return {"error": f"Exception occurred: {e!s}"}
  • Registers tools from core_mcp (named 'BC', slugified to 'bc') into the main mcp_app by importing the server with prefix 'bc', resulting in tool name 'bc_get_interpro_entry'.
    for mcp in [core_mcp, *(await get_openapi_mcps())]:
        await mcp_app.import_server(
            mcp,
            slugify(mcp.name),
        )
    logger.info("MCP server setup complete.")
  • Defines core_mcp FastMCP server instance named 'BC', which provides the namespace for tool registration via @core_mcp.tool(). Tools are later prefixed with 'bc_'.
    core_mcp = FastMCP(  # type: ignore
        "BC",
        instructions="Provides access to biomedical knowledge bases.",
    )
  • Exports the get_interpro_entry tool function for use in the module namespace.
    from ._get_interpro_entry import get_interpro_entry
    from ._get_protein_domains import get_protein_domains
    from ._search_interpro_entries import search_interpro_entries
    
    __all__ = [
        "get_interpro_entry",
        "get_protein_domains",
        "search_interpro_entries",
    ]
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool returns metadata and optionally includes interactions, pathways, or cross-references, but lacks details on error handling, rate limits, authentication needs, or data freshness. The description adds some behavioral context but is incomplete for a tool with no annotations.

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 concise and front-loaded, stating the purpose in the first sentence and return format in the second. However, the second sentence could be more integrated to avoid redundancy, and there is minor structural awkwardness in the 'Returns:' section formatting.

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

Completeness4/5

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

Given the tool's moderate complexity (4 parameters, 1 required), 100% schema coverage, and presence of an output schema, the description is reasonably complete. It covers purpose and return types, but could benefit from more behavioral details since no annotations are provided. The output schema reduces the need to explain return values in the description.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'optionally interactions/pathways/cross-references', which aligns with the boolean parameters but does not provide additional semantics. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verb ('Get') and resource ('InterPro entry details'), specifying it returns metadata from member databases like PFAM and PROSITE. It distinguishes from sibling tools by focusing on InterPro entries, unlike others that handle drugs, proteins, or publications.

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

Usage Guidelines3/5

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

The description implies usage for retrieving InterPro entry details, but does not explicitly state when to use this tool versus alternatives like 'bc_search_interpro_entries' or other data retrieval tools. No exclusions or prerequisites are mentioned, leaving usage context inferred rather than guided.

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/biocontext-ai/knowledgebase-mcp'

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