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". 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

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. Changed1 schema field changed
    • 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."
  2. 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."
  3. 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"
      -]
  4. 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."
  5. 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."
  6. 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"
      +  }
      +]
  7. 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)."
  8. 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."
  9. 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."
  10. 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."
  11. 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"
      +]
  12. First observed

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 carry per-value study counts, which is useful behavior context, but says nothing about ordering, pagination, or how large the value sets can be.

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 sentences, front-loaded with the purpose and followed by the usage case. No filler, though the enumerated example fields are redundant with the schema's own examples.

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?

An output schema exists, so return values need no explanation, and the description covers purpose plus the pre-search exploration workflow. Adequate for a single-parameter read tool.

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%, and the description's examples (OverallStatus, Phase, InterventionType, StudyType, LeadSponsorClass) repeat the same field names already listed in the schema. Baseline 3 is appropriate when the schema does the parameter heavy lifting.

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.' That is distinct from siblings like search_studies or get_study_record. It stops short of naming which sibling (get_field_definitions) it differs from, so it is clear but not fully differentiated.

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 condition tied to search preparation. No explicit when-not or alternative-tool routing, so it falls just short of the top band.

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.