Skip to main content
Glama

Clinicaltrials Get Field Values

clinicaltrials_get_field_values
Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
fieldsYesPascalCase 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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
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. Changed7 schema fields changed
    • 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."
  2. Changed6 schema fields changed
    • 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"
      -]
  3. Changed2 schema fields changed
    • 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."
  4. Changed2 schema fields changed
    • 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."
  5. Changed1 schema field changed
    • 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"
      +  }
      +]
  6. Changed1 schema field changed
    • changedOutput schema / properties / fieldStats / description
      Previous value: -"Statistics per requested field."New 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)."
  7. Changed2 schema fields changed
    • changedInput schema / properties / fields / anyOf
      Previous value: -[
      -  {
      -    "description": "A single PascalCase piece name.",
      -    "type": "string"
      -  },
      -  {
      -    "description": "Multiple PascalCase piece names.",
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "description": "A single PascalCase field name.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Multiple PascalCase field names.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / fields / description
      Previous value: -"PascalCase piece name(s) to get values for. Common fields: OverallStatus, Phase, StudyType, InterventionType, LeadSponsorClass, Sex, StdAge, DesignAllocation, DesignPrimaryPurpose, DesignMasking."New 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."
  8. Changed3 schema fields changed
    • changedInput schema / properties / fields / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "description": "A single PascalCase piece name.",
      +    "type": "string"
      +  },
      +  {
      +    "description": "Multiple PascalCase piece names.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • addedOutput schema / properties / fieldStats / items / description
      Added value: +"Statistics for a single requested field."
    • addedOutput schema / properties / fieldStats / items / properties / topValues / items / description
      Added value: +"A value and its study count."
  9. Changed1 schema field changed
    • changedOutput schema / properties / fieldStats / items / properties / topValues / description
      Previous value: -"Values ranked by frequency. Present for ENUM/STRING fields."New value: +"Values ranked by frequency (capped at 250 by the API). Present for ENUM/STRING fields."
  10. Changed6 schema fields changed
    • addedOutput schema / properties / fieldStats / items / properties / falseCount
      Added value: +{
      +  "description": "Studies where field is false. Present for BOOLEAN fields.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / fieldStats / items / properties / missingStudiesCount
      Added value: +{
      +  "description": "Number of studies where this field is absent.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / fieldStats / items / properties / topValues / description
      Previous value: -"Values ranked by frequency."New value: +"Values ranked by frequency. Present for ENUM/STRING fields."
    • addedOutput schema / properties / fieldStats / items / properties / trueCount
      Added value: +{
      +  "description": "Studies where field is true. Present for BOOLEAN fields.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / fieldStats / items / properties / type / description
      Previous value: -"Field data type (ENUM, STRING, DATE, etc.)."New value: +"Field data type (ENUM, BOOLEAN, STRING, DATE, etc.)."
    • changedOutput schema / properties / fieldStats / items / required
      Previous value: -[
      -  "field",
      -  "piece",
      -  "type",
      -  "uniqueValuesCount",
      -  "topValues"
      -]New value: +[
      +  "field",
      +  "piece",
      +  "type"
      +]
  11. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, covering the safety profile. The description adds one behavioral detail beyond that — results are aggregated with per-value study counts — but says nothing about result size, pagination, or whether values are exhaustive for a field.

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?

Two tight sentences: purpose first, then the action-oriented usage note with inline examples. No filler and the most important framing (explore before searching) is front-loaded.

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, the description needn't explain return values, and it correctly focuses on purpose and usage. It is complete enough to invoke correctly; only cross-tool routing to the field-definitions sibling is absent.

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 already documents the single 'fields' parameter, including PascalCase format, examples, and the empty-list rejection. The description's example field list (OverallStatus, Phase, etc.) duplicates the schema's own examples, adding no new meaning.

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?

The description states a specific verb and resource ('Discover valid values for ClinicalTrials.gov fields') and even discloses the return payload ('study counts per value'). It distinguishes itself contextually by framing usage 'before building a search', but never names the sibling tools (e.g. clinicaltrials_get_field_definitions or clinicaltrials_search_studies) to sharpen the boundary.

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?

It gives clear situational guidance: 'Use to explore available filter options before building a search.' That tells the agent when to reach for it, but it offers no exclusion conditions and does not name the alternative tool (clinicaltrials_get_field_definitions) that also deals with field names.

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.