get_disease_targets_summary
Retrieve a comprehensive summary of all targets linked to a specific disease using its EFO ID, with options to filter by association score and limit the number of results.
Instructions
Get overview of all targets associated with a disease
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diseaseId | Yes | Disease EFO ID | |
| minScore | No | Minimum association score (0-1) | |
| size | No | Number of targets to return (1-500, default: 50) |
Implementation Reference
- src/index.ts:510-564 (handler)The handler function that validates input, executes a GraphQL query to fetch associated targets for a given disease EFO ID, processes the response to create a summary with top targets, and returns formatted JSON output.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, }; } }
- src/index.ts:253-261 (schema)JSON schema defining the input parameters for the tool, including required diseaseId and optional minScore and size.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:250-262 (registration)Tool registration in the list of available tools, including name, description, and input schema.{ 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)Dispatch case in the CallToolRequestSchema handler that routes calls to the specific handler function.case 'get_disease_targets_summary': return this.handleGetDiseaseTargetsSummary(args);