Skip to main content
Glama
Augmented-Nature

Reactome MCP Server

get_pathway_participants

Retrieve all molecules (proteins, genes, compounds) involved in a specific Reactome pathway using its stable identifier.

Instructions

Get all molecules (proteins, genes, compounds) participating in a pathway

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesReactome pathway stable identifier

Implementation Reference

  • The main handler function that executes the tool logic: validates input, resolves pathway ID, fetches participants from Reactome API using primary endpoint /data/pathway/{id}/participatingMolecules with fallbacks to extract from events or basic info, formats results.
    private async handleGetPathwayParticipants(args: any) {
      if (!isValidIdArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Pathway ID is required');
      }
    
      try {
        // Resolve pathway ID if it's a name
        const pathwayId = await this.resolvePathwayId(args.id);
        if (!pathwayId) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  error: `No pathway found for identifier: ${args.id}`,
                  suggestion: 'Try using a Reactome stable identifier (e.g., R-HSA-1640170) or search for the pathway first'
                }, null, 2),
              },
            ],
            isError: true,
          };
        }
    
        // Try alternative approaches for getting participants
        let participants = [];
    
        try {
          // Try the working endpoint for participating molecules
          const response = await this.apiClient.get(`/data/pathway/${pathwayId}/participatingMolecules`);
          participants = response.data || [];
        } catch (error1) {
          try {
            // Alternative: get pathway details and extract participants from events
            const pathwayDetails = await this.apiClient.get(`/data/query/${pathwayId}`);
            if (pathwayDetails.data.hasEvent) {
              participants = pathwayDetails.data.hasEvent.map((event: any) => ({
                stId: event.stId || event.dbId,
                name: event.displayName || event.name,
                schemaClass: event.schemaClass,
                identifier: event.stId || event.dbId
              }));
            }
          } catch (error2) {
            // Final fallback: return pathway basic info
            const basicInfo = await this.apiClient.get(`/data/query/${pathwayId}`);
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify({
                    pathwayId: pathwayId,
                    originalQuery: args.id,
                    basicInfo: {
                      name: basicInfo.data.displayName || basicInfo.data.name,
                      type: basicInfo.data.schemaClass,
                      species: basicInfo.data.species?.[0]?.displayName
                    },
                    participantCount: 0,
                    participants: 'Participants data not available via current API endpoints',
                    note: 'Use search_pathways or get_pathway_details for alternative pathway information'
                  }, null, 2),
                },
              ],
            };
          }
        }
    
        const result = {
          pathwayId: pathwayId,
          originalQuery: args.id,
          participantCount: participants.length,
          participants: participants.slice(0, 50).map((participant: any) => ({
            id: participant.stId,
            name: participant.name || participant.displayName,
            type: participant.schemaClass,
            species: participant.species?.[0]?.name || participant.species?.[0]?.displayName,
            identifier: participant.identifier,
            url: `https://reactome.org/content/detail/${participant.stId}`
          }))
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error getting pathway participants: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:282-292 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and input schema.
    {
      name: 'get_pathway_participants',
      description: 'Get all molecules (proteins, genes, compounds) participating in a pathway',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Reactome pathway stable identifier' },
        },
        required: ['id'],
      },
    },
  • src/index.ts:337-338 (registration)
    Dispatch case in the CallToolRequestSchema switch statement that routes to the handler.
    case 'get_pathway_participants':
      return this.handleGetPathwayParticipants(args);
  • Input validation helper function used by the handler to validate pathway ID argument.
    const isValidIdArgs = (args: any): args is { id: string } => {
      return (
        typeof args === 'object' &&
        args !== null &&
        typeof args.id === 'string' &&
        args.id.length > 0
      );
  • Shared helper function used by the handler to resolve pathway names or identifiers to stable Reactome pathway IDs.
    private async resolvePathwayId(identifier: string): Promise<string | null> {
      // If it's already a stable identifier, return it
      if (identifier.match(/^R-[A-Z]{3}-\d+$/)) {
        return identifier;
      }
    
      // Search for the pathway by name
      try {
        const searchResponse = await this.apiClient.get('/search/query', {
          params: {
            query: identifier,
            types: 'Pathway',
            cluster: true
          }
        });
    
        if (searchResponse.data.results &&
            searchResponse.data.results.length > 0 &&
            searchResponse.data.results[0].entries &&
            searchResponse.data.results[0].entries.length > 0) {
          const resolvedId = searchResponse.data.results[0].entries[0].stId;
          return resolvedId;
        }
      } catch (error) {
        // Silently handle pathway resolution errors
      }
    
      return null;
    }
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' data, implying a read-only operation, but doesn't clarify permissions, rate limits, pagination, or the format of returned data. For a tool with no annotations, this leaves significant behavioral gaps.

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 that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, 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 no annotations and no output schema, the description is incomplete. It doesn't explain what the return value looks like (e.g., list format, data structure) or address potential complexities like large result sets. For a tool with minimal structured data, more context is needed to guide effective use.

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?

Schema description coverage is 100%, with the single parameter 'id' documented as a 'Reactome pathway stable identifier'. The description adds no additional parameter semantics beyond this, such as examples or constraints, so it meets the baseline for high schema coverage without compensating value.

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 tool's purpose with a specific verb ('Get') and resource ('all molecules participating in a pathway'), and specifies the types of molecules included (proteins, genes, compounds). However, it doesn't explicitly differentiate from sibling tools like 'get_pathway_details' or 'get_pathway_reactions', which might also return pathway-related information.

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, exclusions, or compare it to sibling tools such as 'find_pathways_by_gene' or 'get_pathway_reactions', leaving the agent to infer usage context from the tool 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