Skip to main content
Glama
Augmented-Nature

OpenTargets MCP Server

get_target_details

Retrieve comprehensive gene target information including drug and disease associations for research analysis using Ensembl gene IDs.

Instructions

Get comprehensive target information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTarget Ensembl gene ID

Implementation Reference

  • The main handler function that implements the core logic of the 'get_target_details' tool. It validates the input using isValidIdArgs, performs a GraphQL query to the Open Targets API to retrieve target details (id, approvedName, approvedSymbol, biotype) based on the Ensembl gene ID, and returns the JSON response or an error message.
    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,
        };
      }
    }
  • The input schema definition for the 'get_target_details' tool, specifying that it requires a single 'id' property of type string representing the Target Ensembl gene ID.
    inputSchema: {
      type: 'object',
      properties: {
        id: { type: 'string', description: 'Target Ensembl gene ID' },
      },
      required: ['id'],
    },
  • src/index.ts:263-273 (registration)
    The tool registration entry in the ListToolsRequestSchema handler, defining the tool's name, description, and input schema for MCP tool discovery.
    {
      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)
    The dispatch case in the CallToolRequestSchema switch statement that routes calls to the 'get_target_details' tool to its handler function.
    case 'get_target_details':
      return this.handleGetTargetDetails(args);
  • Helper function used by the handler to validate that input arguments contain a non-empty string 'id' property, matching the tool's input schema.
    const isValidIdArgs = (args: any): args is { id: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.id === 'string' &&
        args.id.length > 0
      );
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' information, implying a read-only operation, but doesn't clarify aspects like whether it requires authentication, has rate limits, returns structured data, or handles errors. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action, making it easy to parse. However, it could be more structured by explicitly mentioning the parameter or differentiating from siblings, but it earns high marks for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a read operation with one parameter) and lack of annotations and output schema, the description is incomplete. It doesn't explain what 'comprehensive information' includes, how results are formatted, or error handling, leaving gaps for the agent to navigate without sufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'id' parameter documented as 'Target Ensembl gene ID'. The description adds no additional meaning about parameters, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get comprehensive target information' states a clear verb ('Get') and resource ('target information'), but it's vague about what constitutes 'comprehensive' and doesn't distinguish this tool from siblings like 'get_target_disease_associations' or 'search_targets'. It provides a basic purpose but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no guidance on when to use this tool versus alternatives. Given siblings like 'search_targets' (likely for broader queries) and 'get_target_disease_associations' (for related data), there's no indication that this tool is for detailed information on a specific target by ID, leaving the agent to infer usage from the parameter schema alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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