Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_search_interpro_entries

Search InterPro protein family and domain entries by name, type, database, GO term, or species to retrieve matching entries with metadata from biomedical knowledge bases.

Instructions

Search InterPro entries by name, type, database, GO term, or species. Returns matching entries with metadata.

Returns: dict: Search results with results array (InterPro entries), count, total_available, search_criteria or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch term for entry names/descriptions
entry_typeNofamily, domain, homologous_superfamily, repeat, conserved_site, binding_site, active_site, or ptm
source_databaseNopfam, prosite, panther, smart, cdd, hamap, pirsf, prints, etc.
go_termNoGO term filter (e.g., 'GO:0006122')
species_filterNoTaxonomy ID filter (e.g., '9606')
page_sizeNoResults per page (max 200)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'bc_search_interpro_entries' tool. It uses the @core_mcp.tool() decorator and implements the search logic against the InterPro API, including input validation and parameter building.
    @core_mcp.tool()
    def search_interpro_entries(
        query: Annotated[
            Optional[str],
            Field(description="Search term for entry names/descriptions"),
        ] = None,
        entry_type: Annotated[
            Optional[str],
            Field(
                description="family, domain, homologous_superfamily, repeat, conserved_site, binding_site, active_site, or ptm"
            ),
        ] = None,
        source_database: Annotated[
            Optional[str],
            Field(description="pfam, prosite, panther, smart, cdd, hamap, pirsf, prints, etc."),
        ] = None,
        go_term: Annotated[
            Optional[str],
            Field(description="GO term filter (e.g., 'GO:0006122')"),
        ] = None,
        species_filter: Annotated[
            Optional[str],
            Field(description="Taxonomy ID filter (e.g., '9606')"),
        ] = None,
        page_size: Annotated[
            int,
            Field(description="Results per page (max 200)"),
        ] = 20,
    ) -> dict:
        """Search InterPro entries by name, type, database, GO term, or species. Returns matching entries with metadata.
    
        Returns:
            dict: Search results with results array (InterPro entries), count, total_available, search_criteria or error message.
        """
        base_url = "https://www.ebi.ac.uk/interpro/api/entry/interpro"
    
        # Build query parameters
        params: dict[str, str | int] = {}
    
        if page_size > 200:
            page_size = 200
        params["page_size"] = page_size
    
        # Add the search query if provided (this is the key fix!)
        if query:
            params["search"] = query
    
        # Add filters
        if entry_type:
            valid_types = [
                "family",
                "domain",
                "homologous_superfamily",
                "repeat",
                "conserved_site",
                "binding_site",
                "active_site",
                "ptm",
            ]
            if entry_type not in valid_types:
                return {"error": f"Invalid entry_type. Valid options: {', '.join(valid_types)}"}
            params["type"] = entry_type
    
        if source_database:
            valid_dbs = [
                "pfam",
                "prosite",
                "panther",
                "smart",
                "cdd",
                "hamap",
                "pirsf",
                "prints",
                "prodom",
                "ssf",
                "tigrfams",
                "cathgene3d",
                "sfld",
            ]
            if source_database not in valid_dbs:
                return {"error": f"Invalid source_database. Valid options: {', '.join(valid_dbs)}"}
            params["signature_in"] = source_database
    
        if go_term:
            # Validate GO term format
            if not go_term.upper().startswith("GO:") or len(go_term) != 10:
                return {"error": "Invalid GO term format. Expected format: GO:0006122"}
            params["go_term"] = go_term.upper()
    
        if species_filter:
            params["tax_id"] = species_filter
    
        # Add extra fields for more informative results
        params["extra_fields"] = "short_name,description,entry_date"
    
        try:
            response = requests.get(base_url, params=params)
            response.raise_for_status()
    
            search_results = response.json()
    
            if not search_results.get("results"):
                return {"results": [], "count": 0, "message": "No InterPro entries found matching the search criteria"}
    
            # Results are already filtered by the API's search parameter
            results = search_results["results"]
    
            return {
                "results": results,
                "count": len(results),
                "total_available": search_results.get("count", len(results)),
                "search_criteria": {
                    "query": query,
                    "entry_type": entry_type,
                    "source_database": source_database,
                    "go_term": go_term,
                    "species_filter": species_filter,
                },
            }
    
        except requests.exceptions.HTTPError as e:
            return {"error": f"HTTP error: {e}"}
        except Exception as e:
            return {"error": f"Exception occurred: {e!s}"}
  • Definition of the FastMCP server instance 'BC' which automatically prefixes registered tool names with 'bc_' (resulting in 'bc_search_interpro_entries').
    core_mcp = FastMCP(  # type: ignore
        "BC",
        instructions="Provides access to biomedical knowledge bases.",
    )
  • Imports all tools from the interpro module, including search_interpro_entries, making it available for registration via the core_mcp FastMCP instance.
    from .interpro import *
    from .ols import *
  • Re-exports the search_interpro_entries handler function for inclusion in the core module imports.
    from ._search_interpro_entries import search_interpro_entries
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool returns matching entries with metadata and includes a return format hint, which is helpful. However, it lacks details on behavioral traits like pagination behavior (implied by 'page_size' but not explained), rate limits, error conditions, or authentication needs, leaving gaps for a search tool.

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 appropriately sized with two sentences: one stating the purpose and parameters, and another detailing the return format. It's front-loaded with key information, though the return format could be integrated more seamlessly. There's minimal waste, but slight room for improvement in flow.

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 complexity (a search tool with 6 parameters), 100% schema coverage, and an output schema (implied by 'Returns: dict'), the description is reasonably complete. It covers the purpose, parameters at a high level, and return format. However, it lacks behavioral context like pagination details or error handling, which could enhance completeness for a search operation.

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, so the schema fully documents all 6 parameters. The description adds no additional parameter semantics beyond what's in the schema, such as explaining how 'query' interacts with other filters or providing examples. This meets the baseline for high schema coverage.

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 ('Search InterPro entries') and resources ('by name, type, database, GO term, or species'), making the purpose explicit. However, it doesn't distinguish this from sibling tools like 'bc_get_interpro_entry' (which likely retrieves a specific entry) or other search tools, missing full sibling differentiation.

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. It doesn't mention sibling tools like 'bc_get_interpro_entry' for single-entry retrieval or other search tools for different data types, leaving the agent without 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/biocontext-ai/knowledgebase-mcp'

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