Skip to main content
Glama

get_target_details

Retrieve detailed gene target information, including gene-drug-disease associations, using Ensembl gene ID, for research and analysis on the Open Targets platform.

Instructions

Get comprehensive target information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTarget Ensembl gene ID

Implementation Reference

  • The main handler function that validates the input arguments and fetches comprehensive target details using a GraphQL query to the Open Targets API.
    private async handleGetTargetDetails(args: any) { if (!isValidIdArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Target ID is required'); } try { const query = `query GetTarget($ensemblId: String!) { target(ensemblId: $ensemblId) { id approvedName approvedSymbol biotype } }`; const response = await this.graphqlClient.post('', { query, variables: { ensemblId: args.id } }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting target details: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; }
  • Input schema defining the required 'id' parameter for the tool.
    inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Target Ensembl gene ID' }, }, required: ['id'], },
  • src/index.ts:263-273 (registration)
    Tool registration in the list returned by ListToolsRequestSchema, including name, description, and schema.
    { name: 'get_target_details', description: 'Get comprehensive target information', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Target Ensembl gene ID' }, }, required: ['id'], }, },
  • src/index.ts:300-301 (registration)
    Dispatch to the handler in the CallToolRequestSchema switch statement.
    case 'get_target_details': return this.handleGetTargetDetails(args);
  • Type guard function used to validate the input arguments for ID-based tools, including get_target_details.
    const isValidIdArgs = (args: any): args is { id: string } => { return ( typeof args === 'object' && args !== null && typeof args.id === 'string' && args.id.length > 0 );

Other Tools

Related Tools

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