Skip to main content
Glama
Augmented-Nature

ProteinAtlas MCP Server

compare_expression_profiles

Compare protein expression profiles across tissues, brain regions, blood cells, or single-cell data to analyze biological differences between multiple genes.

Instructions

Compare expression profiles between multiple proteins

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genesYesArray of gene symbols to compare (2-10)
expressionTypeNoType of expression data to compare (default: tissue)
formatNoOutput format (default: json)

Implementation Reference

  • Executes the tool by validating input with isValidBatchArgs, fetching expression data (tissue, brain, blood, or default tissue) for each gene, compiling comparisons, and returning JSON or error.
    private async handleCompareExpressionProfiles(args: any) {
      if (!isValidBatchArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid comparison arguments');
      }
    
      try {
        const expressionType = (args as any).expressionType || 'tissue';
        const comparisons = [];
    
        for (const gene of args.genes) {
          let expressionData;
          switch (expressionType) {
            case 'tissue':
              expressionData = await this.fetchTissueExpression(gene);
              break;
            case 'brain':
              expressionData = await this.fetchBrainExpression(gene);
              break;
            case 'blood':
              expressionData = await this.fetchBloodExpression(gene);
              break;
            default:
              expressionData = await this.fetchTissueExpression(gene);
          }
          comparisons.push({ gene, expressionData });
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ expressionComparison: comparisons }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error comparing expression profiles: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • JSON Schema defining the input parameters: genes (array 2-10 strings), expressionType (enum), format (json/tsv). Required: genes.
    inputSchema: {
      type: 'object',
      properties: {
        genes: { type: 'array', items: { type: 'string' }, description: 'Array of gene symbols to compare (2-10)', minItems: 2, maxItems: 10 },
        expressionType: { type: 'string', enum: ['tissue', 'brain', 'blood', 'single_cell'], description: 'Type of expression data to compare (default: tissue)' },
        format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' },
      },
      required: ['genes'],
    },
  • src/index.ts:636-648 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'compare_expression_profiles',
      description: 'Compare expression profiles between multiple proteins',
      inputSchema: {
        type: 'object',
        properties: {
          genes: { type: 'array', items: { type: 'string' }, description: 'Array of gene symbols to compare (2-10)', minItems: 2, maxItems: 10 },
          expressionType: { type: 'string', enum: ['tissue', 'brain', 'blood', 'single_cell'], description: 'Type of expression data to compare (default: tissue)' },
          format: { type: 'string', enum: ['json', 'tsv'], description: 'Output format (default: json)' },
        },
        required: ['genes'],
      },
    },
  • src/index.ts:703-704 (registration)
    Dispatch case in the CallToolRequest handler that routes to the specific handler function.
    case 'compare_expression_profiles':
      return this.handleCompareExpressionProfiles(args);
  • Input validation function reused for batch operations and this tool's args validation.
    const isValidBatchArgs = (
      args: any
    ): args is { genes: string[]; format?: string; columns?: string[] } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        Array.isArray(args.genes) &&
        args.genes.length > 0 &&
        args.genes.length <= 100 &&
        args.genes.every((gene: any) => typeof gene === 'string' && gene.length > 0) &&
        (args.format === undefined || ['json', 'tsv'].includes(args.format)) &&
        (args.columns === undefined || Array.isArray(args.columns))
      );
    };

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/ProteinAtlas-MCP-Server'

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