Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_europepmc_fulltext

Retrieve full text XML content from Europe PMC using a PMC ID. This tool enables access to biomedical literature for AI systems, facilitating research and knowledge extraction.

Instructions

Get the full text XML for a given PMC ID from Europe PMC.

Args: pmc_id (str): PMC ID starting with "PMC" (e.g., "PMC11629965").

Returns: dict: Full text XML content or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmc_idYesPMC ID starting with 'PMC' (e.g., 'PMC11629965')

Implementation Reference

  • The core handler function for the tool, decorated with @core_mcp.tool(). Due to the 'BC' prefix on core_mcp, the tool is named 'bc_get_europepmc_fulltext'. Includes inline schema via Pydantic Annotated Field.
    @core_mcp.tool() def get_europepmc_fulltext( pmc_id: Annotated[str, Field(description="PMC ID (e.g., 'PMC11629965')")], ) -> dict: """Get full-text XML for a PMC ID. Returns the complete article XML for processing and analysis. Returns: dict: Full-text XML content in format {'fulltext_xml': '...'} or error message. """ # Validate PMC ID format pmc_id = pmc_id.strip().upper() if not pmc_id or not pmc_id.startswith("PMC"): return {"error": "PMC ID must start with 'PMC'"} url = f"https://www.ebi.ac.uk/europepmc/webservices/rest/{pmc_id}/fullTextXML" try: response = requests.get(url) response.raise_for_status() # Return the XML content as a string return {"fulltext_xml": response.text} except requests.exceptions.RequestException as e: return {"error": f"Failed to fetch full text XML: {e!s}"}
  • Defines the core_mcp FastMCP instance with name 'BC', which prefixes all decorated tools with 'bc_'.
    core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", )
  • Registers the core_mcp (containing the tool) into the main mcp_app server under the slugified name 'bc'.
    for mcp in [core_mcp, *(await get_openapi_mcps())]: await mcp_app.import_server( mcp, slugify(mcp.name), )
  • Re-exports the get_europepmc_fulltext function for easy import.
    from ._get_europepmc_fulltext import get_europepmc_fulltext __all__ = ["get_europepmc_articles", "get_europepmc_fulltext"]

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