get_disease_details
Retrieve detailed disease information by providing a Disease EFO ID to analyze gene-drug-disease associations using OpenTargets MCP Server data.
Instructions
Get comprehensive disease information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Disease EFO ID |
Implementation Reference
- src/index.ts:602-636 (handler)The handler function for the 'get_disease_details' tool. Validates input, executes a GraphQL query to fetch disease details (id, name, description) from Open Targets API, and returns the JSON response.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, }; } }
- src/index.ts:277-283 (schema)The input schema definition for the 'get_disease_details' tool, specifying an object with a required 'id' string (Disease EFO ID).inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Disease EFO ID' }, }, required: ['id'], },
- src/index.ts:274-284 (registration)Tool registration in the list of tools returned by ListToolsRequestHandler, 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)Switch case in CallToolRequestHandler that routes calls to 'get_disease_details' to the handleGetDiseaseDetails method.case 'get_disease_details': return this.handleGetDiseaseDetails(args);
- src/index.ts:50-57 (helper)Helper function for validating arguments that expect a single 'id' string, used in get_disease_details handler.const isValidIdArgs = (args: any): args is { id: string } => { return ( typeof args === 'object' && args !== null && typeof args.id === 'string' && args.id.length > 0 ); };