Skip to main content
Glama
Augmented-Nature

Reactome MCP Server

get_protein_interactions

Retrieve protein-protein interactions within biological pathways to analyze molecular relationships and regulatory networks in Reactome.

Instructions

Get protein-protein interactions within pathways

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathwayIdYesReactome pathway stable identifier
interactionTypeNoType of interactions to retrieve (default: all)

Implementation Reference

  • The main handler function that implements the core logic for the 'get_protein_interactions' tool. It validates input, resolves the pathway ID, fetches pathway data, proteins, and reactions from the Reactome API, constructs interaction information, and returns formatted JSON.
    private async handleGetProteinInteractions(args: any) {
      if (!isValidInteractionArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid interaction arguments');
      }
    
      try {
        // Resolve pathway ID if it's a name
        const pathwayId = await this.resolvePathwayId(args.pathwayId);
        if (!pathwayId) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  error: `No pathway found for identifier: ${args.pathwayId}`,
                  suggestion: 'Try using a Reactome stable identifier (e.g., R-HSA-1640170) or search for the pathway first'
                }, null, 2),
              },
            ],
            isError: true,
          };
        }
    
        // Get basic pathway information first
        const pathwayInfo = await this.apiClient.get(`/data/query/${pathwayId}`);
    
        // Try multiple approaches to get interaction data
        let proteins = [];
        let reactions = [];
    
        try {
          // Try to get participating molecules
          const participantsResponse = await this.apiClient.get(`/data/pathway/${pathwayId}/participatingMolecules`);
          proteins = participantsResponse.data?.filter((p: any) =>
            p.schemaClass === 'EntityWithAccessionedSequence' || p.schemaClass === 'Protein'
          ) || [];
        } catch (e1) {
          // Alternative: search for proteins related to this pathway
          try {
            const searchResponse = await this.apiClient.get('/search/query', {
              params: {
                query: pathwayInfo.data.displayName || pathwayInfo.data.name,
                types: 'Protein',
                cluster: true
              }
            });
    
            if (searchResponse.data.results) {
              for (const group of searchResponse.data.results) {
                if (group.typeName === 'Protein' && group.entries) {
                  proteins = group.entries.slice(0, 10); // Limit to 10 proteins
                }
              }
            }
          } catch (e2) {
            // Final fallback: extract from pathway hasEvent
            if (pathwayInfo.data.hasEvent) {
              proteins = pathwayInfo.data.hasEvent
                .filter((event: any) => event.schemaClass?.includes('Protein') || event.schemaClass?.includes('Entity'))
                .slice(0, 5);
            }
          }
        }
    
        try {
          // Try to get pathway reactions
          const reactionsResponse = await this.apiClient.get(`/data/pathway/${pathwayId}/containedEvents`);
          reactions = reactionsResponse.data?.filter((event: any) =>
            event.schemaClass === 'Reaction'
          ) || [];
        } catch (e) {
          // Extract reactions from pathway events
          if (pathwayInfo.data.hasEvent) {
            reactions = pathwayInfo.data.hasEvent
              .filter((event: any) => event.schemaClass === 'Reaction')
              .slice(0, 10);
          }
        }
    
        const interactions = {
          pathwayId: pathwayId,
          originalQuery: args.pathwayId,
          basicInfo: {
            name: pathwayInfo.data.displayName || pathwayInfo.data.name,
            type: pathwayInfo.data.schemaClass,
            species: pathwayInfo.data.species?.[0]?.displayName
          },
          proteinCount: proteins.length,
          reactionCount: reactions.length,
          proteins: proteins.slice(0, 20).map((protein: any) => ({
            id: protein.stId || protein.dbId,
            name: protein.name || protein.displayName,
            type: protein.schemaClass,
            identifier: protein.identifier
          })),
          potentialInteractions: reactions.slice(0, 15).map((reaction: any) => ({
            reactionId: reaction.stId || reaction.dbId,
            reactionName: reaction.name || reaction.displayName,
            type: reaction.schemaClass,
            reversible: reaction.reversible
          })),
          note: "Protein interactions inferred from pathway components and reactions. For detailed molecular interactions, consider using specialized protein interaction databases.",
          analysisNote: args.interactionType !== 'all' ? `Filtered for ${args.interactionType} interactions` : 'Showing all available interaction types'
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(interactions, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error getting protein interactions: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The input schema definition for the 'get_protein_interactions' tool, specifying parameters pathwayId (required) and optional interactionType.
    {
      name: 'get_protein_interactions',
      description: 'Get protein-protein interactions within pathways',
      inputSchema: {
        type: 'object',
        properties: {
          pathwayId: { type: 'string', description: 'Reactome pathway stable identifier' },
          interactionType: {
            type: 'string',
            enum: ['protein-protein', 'regulatory', 'catalysis', 'all'],
            description: 'Type of interactions to retrieve (default: all)'
          },
        },
        required: ['pathwayId'],
      },
    },
  • src/index.ts:341-342 (registration)
    Tool registration in the CallToolRequestSchema switch statement, dispatching calls to the handler function.
    case 'get_protein_interactions':
      return this.handleGetProteinInteractions(args);
  • Type guard and validation function specifically for 'get_protein_interactions' input arguments.
    const isValidInteractionArgs = (args: any): args is { pathwayId: string; interactionType?: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.pathwayId === 'string' &&
        args.pathwayId.length > 0 &&
        (args.interactionType === undefined || ['protein-protein', 'regulatory', 'catalysis', 'all'].includes(args.interactionType))
      );
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, error conditions, or the format of returned data. This is a significant gap for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for the tool's complexity, making it easy for an agent to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of interactions, structured data), potential limitations, or how it fits with sibling tools. For a tool with no structured behavioral hints, more context is needed to be fully helpful.

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 schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any additional meaning beyond what's in the schema, such as explaining the significance of 'pathwayId' or 'interactionType' in biological terms. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb 'Get' and the resource 'protein-protein interactions within pathways', making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_pathway_participants' or 'get_pathway_reactions', which might also involve pathway components, so it doesn't reach the highest score.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or compare to sibling tools like 'get_pathway_participants' or 'search_pathways', leaving the agent to infer usage based on the name 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/Reactome-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server