Skip to main content
Glama
Augmented-Nature

OpenTargets MCP Server

get_disease_details

Retrieve comprehensive disease information from OpenTargets platform using EFO ID to support gene-drug-disease association research.

Instructions

Get comprehensive disease information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDisease EFO ID

Implementation Reference

  • The handler function that implements the get_disease_details tool. It validates the input args, executes a GraphQL query to fetch disease details (id, name, description) by EFO ID, and returns the response as text content or an error.
    private async handleGetDiseaseDetails(args: any) {
      if (!isValidIdArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Disease ID is required');
      }
    
      try {
        const query = `query GetDisease($efoId: String!) { disease(efoId: $efoId) { id name description } }`;
    
        const response = await this.graphqlClient.post('', {
          query,
          variables: {
            efoId: args.id
          }
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error getting disease details: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the get_disease_details tool, specifying the required 'id' parameter as a string (Disease EFO ID).
    inputSchema: {
      type: 'object',
      properties: {
        id: { type: 'string', description: 'Disease EFO ID' },
      },
      required: ['id'],
    },
  • src/index.ts:274-284 (registration)
    Registration of the get_disease_details tool in the MCP server's tools list, including name, description, and input schema.
    {
      name: 'get_disease_details',
      description: 'Get comprehensive disease information',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Disease EFO ID' },
        },
        required: ['id'],
      },
    },
  • src/index.ts:302-303 (registration)
    Dispatch case in the main request handler that routes 'get_disease_details' calls to the specific handler method.
    case 'get_disease_details':
      return this.handleGetDiseaseDetails(args);

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

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