Skip to main content
Glama
masa-med-ai

typesafe-screening-mcp

by masa-med-ai

search_and_screen

Run a PubMed search and screen each hit against a clinical question, delivering include/maybe/exclude decisions with match probabilities.

Instructions

Run a PubMed search and judge every hit against the user's query / clinical question (CQ).

Search, abstract retrieval and judgement all happen server-side; only the decisions come back. Use a broad, sensitive query - screening is cheap (hundreds of articles in seconds) - and let the judgement do the narrowing.

Args: pubmed_query: PubMed search expression (field tags, MeSH, boolean operators). Put date, language and numeric limits here, e.g. ("2021/01/01"[dp] : "3000"[dp]); Jev is unreliable with numbers and dates. research_question: The user's query or CQ, as ONE self-contained sentence in ENGLISH (Jev is most accurate in English and reads literally - translate Japanese input, spell out abbreviations, avoid negations/double negatives). max_results: Screen at most this many hits, taken in PubMed relevance order (max 5000). Check "total_hits" against "screened" in the result to see whether hits were left out. inclusion_criteria: Optional extra criteria, each a short positive English statement (e.g. "The study is a randomized controlled trial"). An unmet criterion demotes include to maybe; it never excludes, since abstracts often omit such details. exclusion_criteria: Optional; a confidently met criterion excludes the article (e.g. "The article is a case report"). include_threshold: match probability at or above which an article is included. exclude_threshold: match probability at or below which an article is excluded. return_decisions: Which groups to list in "results". Default ["include", "maybe", "error"]; "counts" always covers every article. Add "exclude" only for small batches. save_full_results_to: Optional file path (.json). Every result, including excluded articles, is written there in full detail. Fails if the file already exists. detailed: False (default) returns one line per article, grouped by decision: "PMID | match | title". True returns every probability per article (much longer).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailedNo
max_resultsNo
pubmed_queryYes
return_decisionsNo
exclude_thresholdNo
include_thresholdNo
research_questionYes
exclusion_criteriaNo
inclusion_criteriaNo
save_full_results_toNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations available, the description carries the full burden and does so thoroughly. It discloses server-side processing, the irrelevance of numerical limits in Jev, threshold behavior for include/exclude, the demotion of include to maybe when inclusion criteria are unmet, file-overwrite failure for save_full_results_to, and the exact output grouping behavior. This is far beyond a generic statement and gives an agent actionable expectations.

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 long, but the tool has 10 parameters and complex behavior; every sentence adds operational value. It is front-loaded with the core purpose and key performance guidance, followed by a logically ordered parameter breakdown. No filler or repeated information is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters, no output schema, and no annotations, the description provides all the information needed to call and interpret the tool correctly. It explains output groups ('include', 'maybe', 'error'), how to detect incomplete screening via 'total_hits' vs 'screened', the detailed vs concise output formats, and edge cases like overwrite failures. Nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate for all 10 parameters. The Args section documents every parameter with practical detail: examples for pubmed_query, the one-sentence English requirement for research_question, the meaning of thresholds, the effect of inclusion vs exclusion criteria, and the default return groups. This fully replaces missing schema descriptions.

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 opens with a specific verb and resource: 'Run a PubMed search and judge every hit against the user's query / clinical question'. This clearly differentiates search_and_screen from its siblings (screen_pmids, screen_records), which evaluate already-supplied PMIDs or records rather than performing their own PubMed search.

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 gives strong contextual guidance: 'Use a broad, sensitive query - screening is cheap' and notes that 'search, abstract retrieval and judgement all happen server-side'. It does not explicitly name alternatives or state when not to use this tool, but the clear search-based scope makes the comparison to the screen-only siblings apparent. It stops short of an explicit either/or routing rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools