Skip to main content
Glama

ConductScience library

Count records

library_count
Read-onlyIdempotent

Counts the records a find in one library database lists, by the values of one field, largest count first. Its databases, by the name the database input takes:

  • trials: by status, phase, size, year, condition, sponsor: The field to count: status, phase, participants (size), year, condition or lead sponsor. A count by year reads the year of the date asked, while the year input still keeps the trials first posted in its year. q: Words from a trial's title, conditions, interventions, sponsor or registered outcomes, its NCT number, or another registry's ID, as Find trials reads them. kind with-results: Only the trials that posted results to ClinicalTrials.gov. date first-posted, start, primary-completion, completion, results-first-posted, last-updated: The date that from, to and a count by year read: the day a trial was first posted, first posted results or was last updated, or the start, primary completion or completion it states as a year, month or day, which from and to compare by year. First posted when not given. from: Only the trials whose date is this day or later: a year from 1900 to 2099, which starts on 1 January, or a day as YYYY-MM-DD, such as 2020 or 2020-06-30. A trial with no date of that kind is left out. to: Only the trials whose date is this day or earlier: a year from 1900 to 2099, which ends on 31 December, or a day as YYYY-MM-DD, such as 2024 or 2024-12-31. A trial with no date of that kind is left out.

  • patent-sequences: by applicant, office, kind_code, molecule, year: The field to count. A count by year reads the year of the date asked. q: A publication's number, a reviewed UniProt accession, or words from titles and applicants, as Find patent publications reads them. kind uniprot: Only the publications with a sequence identical to a reviewed UniProt protein. date published, filed, priority: The date that from, to and a count by year read: the day a publication was published, the day its application was filed, or its earliest priority date. Published when not given. from: Only the publications whose date is this day or later: a year from 1900 to 2099, which starts on 1 January, or a day as YYYY-MM-DD, such as 2020 or 2020-06-30. A publication with no date of that kind is left out. to: Only the publications whose date is this day or earlier: a year from 1900 to 2099, which ends on 31 December, or a day as YYYY-MM-DD, such as 2024 or 2024-12-31. A publication with no date of that kind is left out.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>",
      "by": "<by>"
    },
    "name": "library_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoIts form for each database is in that database's line of this tool's description.
byYesIts form for each database is in that database's line of this tool's description.
toNoIts form for each database is in that database's line of this tool's description.
topNoHow many values to list, largest count first: 10 when not given. A count by year lists every year and does not read it.
dateNoIts form for each database is in that database's line of this tool's description.
fromNoIts form for each database is in that database's line of this tool's description.
kindNoIts form for each database is in that database's line of this tool's description.
sizeNoTrials only. Only the trials whose participants, actual or estimated, are in this range.
testNoTrials only. A ConductCognition test's ID, such as stroop: only the trials whose registered outcomes name that test.
yearNoTrials only. Only the trials first posted in this year.
phaseNoTrials only. Only the trials of this phase. A trial of phase 1 and 2 is in both.
officeNoPatent sequences only. Only the publications of this office, such as US, EP or JP, or WO for an international application.
statusNoTrials only. Only the trials with this status, ClinicalTrials.gov's in lower case with dashes, such as recruiting or not-yet-recruiting.
sponsorNoTrials only. Only the trials with this lead sponsor, as the trials write it.
databaseYesThe database, by the name this tool's description lists it under.
moleculeNoPatent sequences only. Only the publications that list a nucleotide sequence, or a protein sequence. A publication that lists both is in both.
applicantNoPatent sequences only. Only the publications of this applicant, as the publications name it, such as Genentech, Inc.
conditionNoTrials only. Only the trials that name this condition, as the trials write it, such as Stress.
kind_codeNoPatent sequences only. Only the publications of this kind code, as a publication prints it, such as B2 or A1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description adds real behavior beyond that: result ordering (largest count first), the default date kind when `date` is omitted ('First posted when not given', 'Published when not given'), and exclusion semantics ('A trial with no date of that kind is left out'). It does not describe the shape of the returned counts, but that is a minor omission.

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

Conciseness3/5

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

The leading sentence is well front-loaded, and splitting semantics by database is a sensible structure. However, the from/to blocks are repeated nearly verbatim for both databases, and the phrasing is awkward and dense ('The date that from, to and a count by year read'), making it harder to scan than the parameter count requires.

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?

For a 19-parameter tool with no output schema, the description covers the hard parts: database-scoped parameter applicability, enum meanings, date defaults, and exclusion rules for missing dates. The main gap is that it never describes the returned count structure (field/value/count), which the agent must infer, but overall it is sufficient to call the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the schema descriptions for q, by, date, from, to and kind deliberately defer to this description ('Its form for each database is in that database's line of this tool's description'), so the description is carrying the actual per-database semantics. It defines which values `by` accepts per database, what each date kind means, inclusive year/day semantics for from/to, and filters like with-results and uniprot. This is genuine added meaning, not repetition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: counts the records a find in one library database lists, grouped by one field, largest count first. The two supported databases are enumerated and the aggregation shape is unambiguous. It does not explicitly contrast itself with siblings like library_find or library_section, which keeps it from a 5.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: it references the query semantics of 'as Find trials reads them' and 'as Find patent publications reads them', which hints that this is the aggregation companion to the find tool. However, there is no explicit when-to-use/when-not guidance and no direct routing statement naming an alternative tool for retrieving the actual records.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources