Skip to main content
Glama
Augmented-Nature

OpenTargets MCP Server

get_disease_targets_summary

Retrieve a summary of gene targets associated with a specific disease, filtered by association score and quantity, for gene-drug-disease research analysis.

Instructions

Get overview of all targets associated with a disease

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diseaseIdYesDisease EFO ID
minScoreNoMinimum association score (0-1)
sizeNoNumber of targets to return (1-500, default: 50)

Implementation Reference

  • The handler function that validates input, executes a GraphQL query to fetch disease-associated targets from Open Targets, processes the top 10 targets into a summary, and returns the result as JSON text.
    private async handleGetDiseaseTargetsSummary(args: any) { if (!isValidIdArgs(args) && !args.diseaseId) { throw new McpError(ErrorCode.InvalidParams, 'Disease ID is required'); } try { const diseaseId = args.diseaseId || args.id; const query = `query GetDiseaseTargetsSummary($efoId: String!) { disease(efoId: $efoId) { id name associatedTargets { count rows { target { id approvedSymbol approvedName } score } } } }`; const response = await this.graphqlClient.post('', { query, variables: { efoId: diseaseId, size: args.size || 50 } }); const diseaseData = response.data.data?.disease; const associations = diseaseData?.associatedTargets; const summary = { diseaseId, diseaseName: diseaseData?.name, totalTargets: associations?.count || 0, topTargets: associations?.rows?.slice(0, 10).map((assoc: any) => ({ targetId: assoc.target.id, targetSymbol: assoc.target.approvedSymbol, targetName: assoc.target.approvedName, associationScore: assoc.score, datatypeScores: assoc.datatypeScores, })) || [], fullResults: response.data, }; return { content: [ { type: 'text', text: JSON.stringify(summary, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting disease targets summary: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • The tool registration entry defining the name, description, and input schema (diseaseId required, optional minScore and size). Note: minScore is defined but not used in handler.
    { name: 'get_disease_targets_summary', description: 'Get overview of all targets associated with a disease', inputSchema: { type: 'object', properties: { diseaseId: { type: 'string', description: 'Disease EFO ID' }, minScore: { type: 'number', description: 'Minimum association score (0-1)', minimum: 0, maximum: 1 }, size: { type: 'number', description: 'Number of targets to return (1-500, default: 50)', minimum: 1, maximum: 500 }, }, required: ['diseaseId'], }, },
  • src/index.ts:298-299 (registration)
    The switch case in the request handler that dispatches calls to this tool to its handler method.
    case 'get_disease_targets_summary': return this.handleGetDiseaseTargetsSummary(args);
  • src/index.ts:240-286 (registration)
    The server.setTools call registering all tools including this one (full tools array spans lines ~190-285).
    type: 'object', properties: { targetId: { type: 'string', description: 'Target Ensembl gene ID' }, diseaseId: { type: 'string', description: 'Disease EFO ID' }, minScore: { type: 'number', description: 'Minimum association score (0-1)', minimum: 0, maximum: 1 }, size: { type: 'number', description: 'Number of results to return (1-500, default: 25)', minimum: 1, maximum: 500 }, }, required: [], }, }, { name: 'get_disease_targets_summary', description: 'Get overview of all targets associated with a disease', inputSchema: { type: 'object', properties: { diseaseId: { type: 'string', description: 'Disease EFO ID' }, minScore: { type: 'number', description: 'Minimum association score (0-1)', minimum: 0, maximum: 1 }, size: { type: 'number', description: 'Number of targets to return (1-500, default: 50)', minimum: 1, maximum: 500 }, }, required: ['diseaseId'], }, }, { name: 'get_target_details', description: 'Get comprehensive target information', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Target Ensembl gene ID' }, }, required: ['id'], }, }, { name: 'get_disease_details', description: 'Get comprehensive disease information', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Disease EFO ID' }, }, required: ['id'], }, }, ], }));

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