Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_search_interpro_entries

Search InterPro entries by name, type, source database, GO terms, or species taxonomy. Retrieve up to 200 results to analyze protein families, domains, and functional annotations.

Instructions

Search InterPro entries by various criteria.

This function allows searching the InterPro database using different filters such as entry type, source database, GO terms, and species.

Args: query (str, optional): Search term for InterPro entry names or descriptions. entry_type (str, optional): Filter by entry type (family, domain, etc.). source_database (str, optional): Filter by member database (pfam, prosite, etc.). go_term (str, optional): Filter by GO term (e.g., "GO:0006122"). species_filter (str, optional): Filter by taxonomy ID (e.g., "9606" for human). page_size (int, optional): Number of results to return (max 200). Defaults to 20.

Returns: dict: Search results with InterPro entries matching the criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entry_typeNoFilter by entry type: family, domain, homologous_superfamily, repeat, conserved_site, binding_site, active_site, ptm
go_termNoFilter by GO term (e.g., 'GO:0006122')
page_sizeNoNumber of results to return (max 200)
queryNoSearch term for InterPro entry names or descriptions
source_databaseNoFilter by member database: pfam, prosite, panther, smart, etc.
species_filterNoFilter by taxonomy ID (e.g., '9606' for human)

Implementation Reference

  • The core handler function for the InterPro search tool. Decorated with @core_mcp.tool() to register it. Implements search logic via EBI InterPro API, with input schema defined via Pydantic Annotated Fields. This becomes the 'bc_search_interpro_entries' tool when prefixed.
    @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}"}
  • Registers the core_mcp server (containing the search_interpro_entries tool) into the main MCP app with prefix 'bc' (slugify('BC')). This makes the tool available as 'bc_search_interpro_entries'.
    for mcp in [core_mcp, *(await get_openapi_mcps())]: await mcp_app.import_server( mcp, slugify(mcp.name), )
  • Defines the core_mcp FastMCP instance named 'BC', which collects tools from biocontext_kb.core modules, including the interpro tools. Later imported with 'bc' prefix.
    core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", )

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

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