Skip to main content
Glama
cyanheads

clinicaltrialsgov-mcp-server

by cyanheads

Clinicaltrials Get Field Values

clinicaltrials_get_field_values
Read-onlyIdempotent

Discover valid ClinicalTrials.gov field values and study counts per value to explore filter options before building a search. Check status, phase, study type, or sponsor class values.

Instructions

Discover valid values for ClinicalTrials.gov fields with study counts per value. Use to explore available filter options before building a search — e.g., valid OverallStatus, Phase, InterventionType, StudyType, or LeadSponsorClass values.

Input Schema

NameRequiredDescriptionDefault
fieldsYesPascalCase field name(s) to get value statistics for — an empty list is rejected, not treated as "every field". A comma- or pipe-joined string ("Phase,StudyType") is split into separate names. Examples: OverallStatus, Phase, StudyType, Sex, LeadSponsorClass. Use clinicaltrials_get_field_definitions with a query to find more field names.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoPresent when a longest value was cut to a preview — names, for each such field, the clinicaltrials_search_studies arguments that return its full text.
fieldStatsNoOne entry per requested field: canonical path, PascalCase piece name, data type, and the statistics variant that type carries — top values with study counts plus unique/longest for ENUM/STRING, trueCount/falseCount for BOOLEAN, min/max/avg for INTEGER/NUMBER, min/max/formats for DATE.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv2.10.1
    • changedOutput schema / properties / fieldStats / items / properties / longest / properties / length / description
      Previous value: -"Its length in characters."New value: +"Full length of the recorded value in characters, even when truncated."
    • addedOutput schema / properties / fieldStats / items / properties / longest / properties / truncated
      Added value: +{
      +  "const": true,
      +  "description": "True when value is a preview of at most 2,000 characters; absent when value is whole. The notice names the clinicaltrials_search_studies call that returns the full text.",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / fieldStats / items / properties / longest / properties / value / description
      Previous value: -"The longest recorded value."New value: +"The longest recorded value — when truncated is true, only a prefix of at most 2,000 characters (1,999 when the cut would split a surrogate pair)."
    • changedOutput schema / properties / fieldStats / items / properties / uniqueValuesCount / description
      Previous value: -"Number of distinct values."New value: +"Number of distinct values, as ClinicalTrials.gov reports it. Free-text STRING fields it does not count (DetailedDescription, EligibilityCriteria) report 0 here alongside uniqueValuesCounted: false — that 0 is not a count. A 0 without the flag means no recorded values."
    • addedOutput schema / properties / fieldStats / items / properties / uniqueValuesCounted
      Added value: +{
      +  "const": false,
      +  "description": "False when ClinicalTrials.gov did not count distinct values for this field, so the uniqueValuesCount of 0 is not a real count — the field has recorded values (see longest) but no topValues. Absent otherwise.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Present when a longest value was cut to a preview — names, for each such field, the clinicaltrials_search_studies arguments that return its full text.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv2.10.0
    • changedInput schema / properties / fields / description
      Previous value: -"PascalCase field name(s) to get value statistics for — an empty list is rejected, not treated as \"every field\". Examples: OverallStatus, Phase, StudyType, Sex, LeadSponsorClass. Use clinicaltrials_get_field_definitions with a query to find more field names."New value: +"PascalCase field name(s) to get value statistics for — an empty list is rejected, not treated as \"every field\". A comma- or pipe-joined string (\"Phase,StudyType\") is split into separate names. Examples: OverallStatus, Phase, StudyType, Sex, LeadSponsorClass. Use clinicaltrials_get_field_definitions with a query to find more field names."
  3. Changed7 schema fields changedv2.9.6
    • changedOutput schema / properties / fieldStats / description
      Previous value: -"One entry per requested field: canonical path, PascalCase piece name, data type, missing/unique counts, and top values with study counts (or trueCount/falseCount for BOOLEAN fields)."New value: +"One entry per requested field: canonical path, PascalCase piece name, data type, and the statistics variant that type carries — top values with study counts plus unique/longest for ENUM/STRING, trueCount/falseCount for BOOLEAN, min/max/avg for INTEGER/NUMBER, min/max/formats for DATE."
    • addedOutput schema / properties / fieldStats / items / properties / avg
      Added value: +{
      +  "description": "Mean of the recorded values. Present for INTEGER/NUMBER fields.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / fieldStats / items / properties / formats
      Added value: +{
      +  "description": "Date patterns this field is recorded in. Present for DATE fields; more than one means the field mixes precisions across studies.",
      +  "items": {
      +    "description": "A date pattern, e.g. \"yyyy-MM-dd\".",
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / fieldStats / items / properties / longest
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Longest recorded value with its length and a study carrying it. Present for STRING fields only.",
      +  "properties": {
      +    "length": {
      +      "description": "Its length in characters.",
      +      "type": "number"
      +    },
      +    "nctId": {
      +      "description": "NCT ID of a study carrying it.",
      +      "type": "string"
      +    },
      +    "value": {
      +      "description": "The longest recorded value.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "value",
      +    "length",
      +    "nctId"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / fieldStats / items / properties / max
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Largest value of an INTEGER/NUMBER field.",
      +      "type": "number"
      +    },
      +    {
      +      "description": "Latest value of a DATE field, at the precision recorded.",
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Largest recorded value — a number for INTEGER/NUMBER, a date string for DATE."
      +}
    • addedOutput schema / properties / fieldStats / items / properties / min
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Smallest value of an INTEGER/NUMBER field.",
      +      "type": "number"
      +    },
      +    {
      +      "description": "Earliest value of a DATE field, at the precision recorded — a partial date such as \"1900-01\" stays partial.",
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Smallest recorded value — a number for INTEGER/NUMBER, a date string for DATE."
      +}
    • changedOutput schema / properties / fieldStats / items / properties / multiValued / description
      Previous value: -"True when the field is array-typed (a study can carry several values, e.g. Phase, Condition), so the per-value studiesCount buckets sum above the study total. Use to avoid computing a percentage against the corpus."New value: +"True when the field is repeated — array-typed itself (Phase, Condition) or nested under a repeated object (LocationCountry, one per site) — so a study can carry several values and the per-value studiesCount buckets sum above the study total. Use to avoid computing a percentage against the corpus."
  4. Changed6 schema fields changedv2.9.2
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "fieldStats"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `blank_value`: A parameter was supplied with a blank, whitespace-only, or empty-list value. `field_invalid`: A requested field name is not a valid PascalCase piece name. `rate_limited`: ClinicalTrials.gov returned 429 after retry budget exhausted. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "blank_value",
      +            "field_invalid",
      +            "rate_limited"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "fieldStats"
      -]
  5. Changed2 schema fields changedv2.9.1
    • changedInput schema / properties / fields / anyOf
      Previous value: -[
      -  {
      -    "description": "A single PascalCase field name.",
      -    "type": "string"
      -  },
      -  {
      -    "description": "Multiple PascalCase field names (at least one required).",
      -    "items": {
      -      "type": "string"
      -    },
      -    "minItems": 1,
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "description": "A single PascalCase field name.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Multiple PascalCase field names (at least one required).",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / fields / description
      Previous value: -"PascalCase field name(s) to get value statistics for. Examples: OverallStatus, Phase, StudyType, Sex, LeadSponsorClass. Use clinicaltrials_get_field_definitions with a query to find more field names."New value: +"PascalCase field name(s) to get value statistics for — an empty list is rejected, not treated as \"every field\". Examples: OverallStatus, Phase, StudyType, Sex, LeadSponsorClass. Use clinicaltrials_get_field_definitions with a query to find more field names."
  6. Changed3 schema fields changedv2.7.1
    • changedInput schema / properties / fields / anyOf
      Previous value: -[
      -  {
      -    "description": "A single PascalCase field name.",
      -    "type": "string"
      -  },
      -  {
      -    "description": "Multiple PascalCase field names.",
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "description": "A single PascalCase field name.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Multiple PascalCase field names (at least one required).",
      +    "items": {
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • addedOutput schema / properties / fieldStats / items / properties / multiValued
      Added value: +{
      +  "description": "True when the field is array-typed (a study can carry several values, e.g. Phase, Condition), so the per-value studiesCount buckets sum above the study total. Use to avoid computing a percentage against the corpus.",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / fieldStats / items / properties / topValues / description
      Previous value: -"Values ranked by frequency (capped at 250 by the API). Present for ENUM/STRING fields."New value: +"Values ranked by frequency (capped at 250 by the API). Present for ENUM/STRING fields. When multiValued is true, studiesCount sums can exceed the study total."
  7. Addedv2.5.1
  8. Removedv2.4.12
  9. Addedv2.0.6

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint, so the safety profile is covered. The description adds that results include study counts per value, but says nothing about response shape details, error behavior, or limits beyond what the output schema likely conveys.

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?

Two tight sentences with the core purpose front-loaded and the usage hint following. No wasted clauses, though the example list is somewhat redundant with the schema.

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?

With an output schema present and full parameter coverage, the description only needs to convey purpose and usage, which it does. Minor gaps around what the counts represent or ordering behavior keep it from a 5.

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 parameter's PascalCase form, list handling, and splitting behavior are already documented in the schema. The description's examples (OverallStatus, Phase, etc.) largely duplicate the schema examples, adding little beyond baseline.

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 ('Discover valid values for ClinicalTrials.gov fields with study counts per value') and enumerates example fields. It hints at its role relative to search via 'before building a search,' but does not explicitly name the sibling tools it differs from, so it falls short of 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 Guidelines4/5

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

'Use to explore available filter options before building a search' gives a clear when-to-use context and sequencing. There are no explicit exclusions or named alternatives in the description itself, so it is clear context rather than full when/when-not guidance.

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