Skip to main content
Glama

get_subject_phenotypes

Retrieve phenotype data and demographics for GTEx subjects to analyze genetic associations across human tissues.

Instructions

Get subject phenotype data and demographics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectIdNoGTEx subject ID (optional, for specific subject)
datasetIdNoGTEx dataset ID (default: gtex_v8)gtex_v8

Implementation Reference

  • The main handler function getSubjects() that implements the tool logic: fetches subject phenotype data from GTEx API and formats detailed demographics output based on number of subjects.
    async getSubjects(args: any) {
      const result = await this.apiClient.getSubjects(
        args.datasetId || 'gtex_v8',
        args.sex,
        args.ageBrackets,
        args.hardyScale,
        args.subjectIds
      );
    
      if (result.error) {
        return {
          content: [{
            type: "text",
            text: `Error retrieving subject information: ${result.error}`
          }],
          isError: true
        };
      }
    
      const subjects = result.data || [];
      if (subjects.length === 0) {
        return {
          content: [{
            type: "text",
            text: "No subjects found matching the specified criteria."
          }]
        };
      }
    
      let output = `**Subject Information (${subjects.length} subjects)**\n`;
      output += `Dataset: ${subjects[0]?.datasetId}\n\n`;
    
      if (subjects.length <= 50) {
        // Detailed view for smaller result sets
        subjects.forEach((subject, index) => {
          output += `${(index + 1).toString().padStart(3)}. **${subject.subjectId}**\n`;
          output += `     • Age: ${subject.ageBracket}\n`;
          output += `     • Sex: ${subject.sex}\n`;
          output += `     • Hardy Scale: ${subject.hardyScale}\n`;
        });
      } else {
        // Summary view for large result sets
        const sexGroups = this.groupBy(subjects, 'sex');
        const ageGroups = this.groupBy(subjects, 'ageBracket');
        const hardyGroups = this.groupBy(subjects, 'hardyScale');
    
        output += `**Demographics Summary:**\n`;
        output += `• **By Sex:**\n`;
        Object.entries(sexGroups).forEach(([sex, count]) => {
          output += `  - ${sex}: ${count} subjects (${((count / subjects.length) * 100).toFixed(1)}%)\n`;
        });
    
        output += `• **By Age Bracket:**\n`;
        Object.entries(ageGroups).forEach(([age, count]) => {
          output += `  - ${age} years: ${count} subjects (${((count / subjects.length) * 100).toFixed(1)}%)\n`;
        });
    
        output += `• **By Hardy Scale:**\n`;
        Object.entries(hardyGroups).forEach(([hardy, count]) => {
          output += `  - ${hardy}: ${count} subjects (${((count / subjects.length) * 100).toFixed(1)}%)\n`;
        });
      }
    
      if (result.paging_info && result.paging_info.totalNumberOfItems > subjects.length) {
        output += `\n**Note:** Showing ${subjects.length} of ${result.paging_info.totalNumberOfItems} total results.\n`;
      }
    
      return {
        content: [{
          type: "text",
          text: output
        }]
      };
    }
  • src/index.ts:745-750 (registration)
    Tool registration in the main dispatch handler: maps 'get_subject_phenotypes' calls to referenceHandlers.getSubjects().
    if (name === "get_subject_phenotypes") {
      return await referenceHandlers.getSubjects({
        subjectIds: args?.subjectId ? [args.subjectId] : undefined,
        datasetId: args?.datasetId
      });
    }
  • Input schema definition for the get_subject_phenotypes tool, including parameters for subjectId (optional) and datasetId (default gtex_v8).
    {
      name: "get_subject_phenotypes",
      description: "Get subject phenotype data and demographics",
      inputSchema: {
        type: "object",
        properties: {
          subjectId: {
            type: "string",
            description: "GTEx subject ID (optional, for specific subject)"
          },
          datasetId: {
            type: "string",
            description: "GTEx dataset ID (default: gtex_v8)", 
            default: "gtex_v8"
          }
        }
      }
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data but doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, or what the output format looks like. For a data retrieval tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence ('Get subject phenotype data and demographics') directly contributes to understanding the tool's function, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of retrieving subject data in a bioinformatics context, the description is incomplete. With no annotations and no output schema, it fails to explain what 'phenotype data and demographics' includes, the data format, or any limitations. This leaves the agent with insufficient context for effective use.

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?

The input schema has 100% description coverage, with clear documentation for both parameters (subjectId and datasetId). The description adds no additional parameter semantics beyond what the schema provides, such as explaining relationships between parameters or usage examples, so it meets the baseline for high schema coverage.

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 clearly states the tool's purpose with a specific verb ('Get') and resource ('subject phenotype data and demographics'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'get_sample_info' or 'get_dataset_info' that might also retrieve subject-related data, so it doesn't fully distinguish its scope.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'get_sample_info' that might overlap, there's no indication of prerequisites, context, or exclusions, leaving the agent to infer usage based on tool names alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Augmented-Nature/GTEx-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server