Skip to main content
Glama
Augmented-Nature

Ensembl MCP Server

get_motif_features

Retrieve transcription factor binding motifs within a specified genomic region to identify potential regulatory elements and analyze gene expression patterns.

Instructions

Get transcription factor binding motifs in genomic region

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionYesGenomic region (chr:start-end)
speciesNoSpecies name (default: homo_sapiens)
binding_matrixNoSpecific binding matrix (optional)

Implementation Reference

  • The handler function that executes the get_motif_features tool. It validates arguments, queries the Ensembl regulatory motif API endpoint (/regulatory/species/{species}/microarray/{region}), and returns the motif features data.
    private async handleGetMotifFeatures(args: any) {
      if (!isValidMotifArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid motif feature arguments');
      }
    
      try {
        const species = this.getDefaultSpecies(args.species);
        const region = this.formatGenomicRegion(args.region);
    
        const params: any = {};
    
        if (args.binding_matrix) {
          params.binding_matrix = args.binding_matrix;
        }
    
        const response = await this.apiClient.get(`/regulatory/species/${species}/microarray/${region}`, { params });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        return this.handleError(error, 'fetching motif features');
      }
    }
  • The input schema definition for the get_motif_features tool, registered in the list_tools handler.
      name: 'get_motif_features',
      description: 'Get transcription factor binding motifs in genomic region',
      inputSchema: {
        type: 'object',
        properties: {
          region: { type: 'string', description: 'Genomic region (chr:start-end)' },
          species: { type: 'string', description: 'Species name (default: homo_sapiens)' },
          binding_matrix: { type: 'string', description: 'Specific binding matrix (optional)' },
        },
        required: ['region'],
      },
    },
  • src/index.ts:861-862 (registration)
    Registration of the get_motif_features tool handler in the CallToolRequestSchema switch statement.
    case 'get_motif_features':
      return this.handleGetMotifFeatures(args);
  • Type guard function used for input validation of get_motif_features tool arguments.
    const isValidMotifArgs = (
      args: any
    ): args is { region: string; species?: string; binding_matrix?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.region === 'string' &&
        args.region.length > 0 &&
        (args.species === undefined || typeof args.species === 'string') &&
        (args.binding_matrix === undefined || typeof args.binding_matrix === 'string')
      );
    };

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

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