Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_europepmc_fulltext

Retrieve complete article XML from EuropePMC using PMC ID for biomedical text processing and analysis.

Instructions

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.

Input Schema

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

Implementation Reference

  • The main handler function for the get_europepmc_fulltext tool (likely the intended bc_get_europepmc_fulltext), decorated with @core_mcp.tool(). It fetches the full-text XML from Europe PMC using the provided PMC ID, validates the ID, handles requests, and returns the XML or error.
    @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}"}
  • Pydantic schema definition for the tool input: pmc_id parameter with description and validation.
    pmc_id: Annotated[str, Field(description="PMC ID (e.g., 'PMC11629965')")],
  • Registration of the tool via the @core_mcp.tool() decorator on the handler function.
    @core_mcp.tool()
  • Exports the tool function in the module __init__.py for import.
    __all__ = ["get_europepmc_articles", "get_europepmc_fulltext"]
  • The FastMCP server instance named 'BC' that collects and serves all @tool decorated functions, including this one.
    core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", )

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