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')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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.",
    )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return format (XML content in a dict) but lacks critical details like authentication requirements, rate limits, error handling specifics, or whether the operation is read-only or has side effects.

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 that are front-loaded with the main purpose. The second sentence about the return format is useful but could be slightly more integrated; overall, it avoids unnecessary verbosity.

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 (single parameter, read-focused operation), the description covers the core purpose and output format. With an output schema available, it doesn't need to detail return values, but it lacks behavioral context like error cases or usage constraints, which slightly reduces completeness.

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 fully documents the 'pmc_id' parameter. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, meeting the baseline for high schema coverage.

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 specific action ('Get full-text XML') and resource ('for a PMC ID'), and distinguishes it from sibling tools like 'bc_get_europepmc_articles' by specifying it returns complete article XML for processing and analysis, not just article metadata or summaries.

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 when to choose this over 'bc_get_europepmc_articles' or other sibling tools, nor does it specify prerequisites or exclusions for usage.

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