Skip to main content
Glama

search_isrctn

Find UK and European clinical trials from academic institutions and research centers not listed on ClinicalTrials.gov. Search by condition or terms like 'pediatric epilepsy'.

Instructions

Search the ISRCTN registry for UK and European clinical trials. Read-only operation. No authentication required. Complements ClinicalTrials.gov by covering trials at UK academic institutions and European research centers not listed on ClinicalTrials.gov. Returns up to 10 results per call, filtered for relevance. Returns 'No ISRCTN trials found.' if no results match. Use for: UK/European trials, academic institution studies, international coverage beyond ClinicalTrials.gov.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesCondition or search terms e.g. 'pediatric epilepsy', 'type 2 diabetes'
max_resultsNoNumber of trials to return, between 1 and 10

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesFormatted list of trials with ISRCTN ID, title, phase, status, sponsor, condition, outcomes, countries, and eligibility criteria.

Implementation Reference

  • MCP tool decorator and handler function for 'search_isrctn'. Decorates the function with @mcp.tool, defines description, output_schema, and the function itself which delegates to the core implementation in tools.py.
    @mcp.tool(
        description=(
            "Search the ISRCTN registry for UK and European clinical trials. "
            "Read-only operation. No authentication required. "
            "Complements ClinicalTrials.gov by covering trials at UK academic institutions "
            "and European research centers not listed on ClinicalTrials.gov. "
            "Returns up to 10 results per call, filtered for relevance. "
            "Returns 'No ISRCTN trials found.' if no results match. "
            "Use for: UK/European trials, academic institution studies, "
            "international coverage beyond ClinicalTrials.gov."
        ),
        output_schema={
            "type": "object",
            "properties": {
                "result": {
                    "type": "string",
                    "description": "Formatted list of trials with ISRCTN ID, title, phase, status, sponsor, condition, outcomes, countries, and eligibility criteria."
                }
            },
            "required": ["result"]
        }
    )
    def search_isrctn(
        query: Annotated[str, "Condition or search terms e.g. 'pediatric epilepsy', 'type 2 diabetes'"],
        max_results: Annotated[int, "Number of trials to return, between 1 and 10"] = 5,
    ) -> str:
        """
        Search the ISRCTN registry for UK and European clinical trials.
    
        Use for: UK/European trials, academic institution studies, and international
        coverage beyond ClinicalTrials.gov.
    
        Args:
            query: Condition or search terms (e.g. "pediatric epilepsy")
            max_results: Number of trials to return (1-10, default 5)
    
        Returns:
            Formatted string with ISRCTN ID, title, phase, status, sponsor, condition,
            primary/secondary outcomes, countries, age range, and eligibility criteria.
            Returns a "no results" message if nothing is found.
    
        Notes:
            - Results are filtered for relevance — query terms must appear in title or condition
            - Requires no API key; uses ISRCTN public WHO-format API
            - Covers UK, European, and some international academic institution trials
        """
        from aria_mcp_server.tools import search_isrctn as _search, format_isrctn_for_claude as _fmt
        max_results = max(1, min(max_results, 10))
        trials = _search(query=query, max_results=max_results)
        return _fmt(trials)
  • Core implementation of search_isrctn. Calls ISRCTN WHO-format API, parses XML response, filters results by relevance using _is_relevant_isrctn, and parses each trial using _parse_isrctn_trial.
    def search_isrctn(query: str, max_results: int = 5) -> list[dict]:
        """Search ISRCTN registry for UK/European clinical trials. No API key required."""
        query = (query or "").strip()
        if not query:
            return []
        max_results = max(1, min(max_results, 20))
        try:
            r = requests.get(
                ISRCTN_BASE,
                params={"q": query, "limit": max_results},
                timeout=15,
            )
            r.raise_for_status()
            data = xmltodict.parse(r.content)
        except Exception as e:
            raise RuntimeError(f"ISRCTN search failed: {e}") from e
    
        trials_el = (data.get("trials") or {}).get("trial")
        if not trials_el:
            return []
        if isinstance(trials_el, dict):
            trials_el = [trials_el]
    
        relevant = [tr for tr in trials_el if _is_relevant_isrctn(tr, query)]
        return [t for t in (_parse_isrctn_trial(tr) for tr in relevant) if t]
  • _parse_isrctn_trial: Parses a raw ISRCTN trial XML dict into a structured dict with trial_id, title, status, phase, sponsor, condition, outcomes, countries, eligibility, age range, and URL.
    def _parse_isrctn_trial(trial: dict) -> dict | None:
        try:
            main = trial.get("main") or {}
            criteria = trial.get("criteria") or {}
            countries_el = trial.get("countries") or {}
    
            trial_id = _get_text(main.get("trial_id"))
            if not trial_id:
                return None
    
            # Handle countries — could be string or list
            country_raw = countries_el.get("country2")
            if isinstance(country_raw, list):
                countries = [c for c in country_raw if c]
            elif country_raw:
                countries = [country_raw]
            else:
                countries = []
    
            inclusion = _get_text(criteria.get("inclusion_criteria"))
            exclusion = _get_text(criteria.get("exclusion_criteria"))
            eligibility = ""
            if inclusion:
                eligibility += f"Inclusion: {inclusion[:300]}..."
            if exclusion:
                eligibility += f"\nExclusion: {exclusion[:300]}..."
    
            return {
                "trial_id": trial_id,
                "title": _get_text(main.get("public_title")),
                "status": _get_text(main.get("recruitment_status")),
                "phase": _get_text(main.get("phase")),
                "sponsor": _get_text(main.get("primary_sponsor")),
                "condition": _get_text(main.get("hc_freetext")),
                "primary_outcome": _get_text(trial.get("primary_outcome", {}).get("prim_outcome"))[:300] + "..." if _get_text(trial.get("primary_outcome", {}).get("prim_outcome")) else "",
                "secondary_outcomes": _get_text(trial.get("secondary_outcome", {}).get("sec_outcome"))[:300] + "..." if _get_text(trial.get("secondary_outcome", {}).get("sec_outcome")) else "",
                "countries": countries,
                "min_age": _get_text(criteria.get("agemin")),
                "max_age": _get_text(criteria.get("agemax")),
                "gender": _get_text(criteria.get("gender")),
                "eligibility_criteria": eligibility,
                "url": _get_text(main.get("url")),
            }
        except (KeyError, TypeError, AttributeError):
            return None
  • _is_relevant_isrctn: Filters ISRCTN results by checking if query terms (words > 3 chars) appear in the trial's public_title or hc_freetext fields.
    def _is_relevant_isrctn(trial: dict, query: str) -> bool:
        """Check if query terms appear in title or condition — not full document."""
        query_words = set(query.lower().split())
        main = trial.get("main") or {}
        searchable = " ".join([
            _get_text(main.get("public_title")),
            _get_text(main.get("hc_freetext")),
        ]).lower()
        significant_words = [w for w in query_words if len(w) > 3]
        if not significant_words:
          return True
        return any(word in searchable for word in significant_words)
  • format_isrctn_for_claude: Formats parsed ISRCTN trial results into a readable text string for display.
    def format_isrctn_for_claude(trials: list[dict]) -> str:
        """Format ISRCTN results as readable text."""
        if not trials:
            return "No ISRCTN trials found matching those criteria."
        lines = []
        for i, t in enumerate(trials, 1):
            countries_str = "; ".join(t.get("countries") or []) or "N/A"
            lines.append("\n".join([
                f"[ISRCTN Trial {i}]",
                f"ISRCTN ID: {t.get('trial_id') or 'N/A'}",
                f"Title: {t.get('title') or 'N/A'}",
                f"Status: {t.get('status') or 'N/A'}",
                f"Phase: {t.get('phase') or 'N/A'}",
                f"Condition: {t.get('condition') or 'N/A'}",
                f"Primary Outcome: {t.get('primary_outcome') or 'N/A'}",
                f"Secondary Outcomes: {t.get('secondary_outcomes') or 'N/A'}",
                f"Sponsor: {t.get('sponsor') or 'N/A'}",
                f"Countries: {countries_str}",
                f"Age Range: {t.get('min_age') or 'N/A'} – {t.get('max_age') or 'N/A'}",
                f"Gender: {t.get('gender') or 'N/A'}",
                f"Eligibility: {t.get('eligibility_criteria') or 'N/A'}",
                f"URL: {t.get('url') or 'N/A'}",
                "",
            ]))
        return "\n".join(lines).strip()
Behavior4/5

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

With no annotations, the description fully discloses behavioral traits: read-only, no authentication, returns up to 10 results per call, filtered for relevance, and returns a specific message when no results are found. This provides adequate transparency for an AI agent to understand side effects and limitations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, using four sentences that each add value: defines purpose, states behavioral traits, differentiates from alternative, and lists use cases. No redundant or wasted wording.

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 simplicity (two parameters, output schema exists) and context signals, the description covers essential aspects: purpose, usage scope, behavioral constraints, and error handling. It does not cover edge cases like empty queries or pagination, but these are not critical for the given complexity.

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 coverage is 100% with both parameters described. The description adds minimal extra value beyond the schema (e.g., 'filtered for relevance' and 'up to 10 results'), but these are not critical. Baseline 3 is appropriate as the schema already documents parameter semantics.

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 tool searches the ISRCTN registry for UK and European clinical trials, specifying it is a read-only operation with no authentication required. It distinguishes itself from ClinicalTrials.gov by explicitly noting which registry it complements, differentiating from the sibling tool search_clinical_trials.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context by stating the tool is for UK/European trials, academic institution studies, and international coverage beyond ClinicalTrials.gov. It does not explicitly mention when not to use it relative to other siblings (e.g., search_pubmed), but the ClinicalTrials.gov comparison implies exclusion.

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/pkotecha-eng/aria-mcp-server'

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