Skip to main content
Glama
cyanheads

clinicaltrialsgov-mcp-server

by cyanheads

Clinicaltrials Get Field Values

clinicaltrials_get_field_values
Read-onlyIdempotent

Find valid values for ClinicalTrials.gov fields with study counts, enabling exploration of filter options before constructing a search query.

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

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, missing/unique counts, and top values with study counts (or trueCount/falseCount for BOOLEAN fields).

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      -]
  2. 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."
  3. 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."
  4. Addedv2.5.1
  5. Removedv2.4.12
  6. Addedv2.0.6

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, so the safety profile is covered. The description adds behavioral context by noting that an empty list is rejected (not treated as 'every field'), which is a useful edge-case disclosure beyond the schema. It also implies the tool returns counts per value, which is behavioral information. No contradiction with annotations.

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 two sentences, front-loaded with the core purpose and immediately followed by a concrete use case. Every sentence earns its place: the first states what it does, the second explains when to use it and gives examples. No fluff or redundancy.

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?

Given the tool's simplicity (one parameter, no nested objects) and the presence of an output schema, the description is largely complete. It covers purpose, usage timing, and parameter semantics. The only minor gap is that it doesn't explicitly state the return format, but the output schema presumably covers that. For a read-only exploration tool, this is sufficient.

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 description coverage is 100%, so the schema already documents the 'fields' parameter well, including examples and the rejection of empty lists. The description adds value by explaining the purpose of the parameter (exploring filter options) and reinforcing the PascalCase requirement. Since coverage is high, a baseline of 3 applies, but the description's extra context about usage and the empty-list rejection pushes it to 4.

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 clearly states the tool's purpose: discovering valid values for ClinicalTrials.gov fields with study counts per value. It names specific example fields (OverallStatus, Phase, InterventionType, StudyType, LeadSponsorClass) and positions it as a pre-search exploration step, distinguishing it from sibling tools like clinicaltrials_get_field_definitions.

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 explicitly says to use this tool 'before building a search' to explore filter options, which provides clear context. It doesn't explicitly state when not to use it or name alternatives, but the sibling list and the reference to clinicaltrials_get_field_definitions for finding more field names give some guidance. A clear usage context is present, though exclusions are not explicit.

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