get_pathway_reactions
Retrieve all biochemical reactions for a specific Reactome pathway using its stable identifier to analyze pathway components and interactions.
Instructions
Get all biochemical reactions within a pathway
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Reactome pathway stable identifier |
Implementation Reference
- src/index.ts:878-941 (handler)Main handler function that validates input, resolves pathway ID, fetches contained events from Reactome API, filters for reactions, and returns formatted reaction list.private async handleGetPathwayReactions(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, }; } const response = await this.apiClient.get(`/data/pathway/${pathwayId}/containedEvents`); // Filter for reactions only const reactions = response.data?.filter((event: any) => event.schemaClass === 'Reaction' || event.schemaClass === 'BlackBoxEvent' ) || []; const pathwayReactions = { pathwayId: pathwayId, originalQuery: args.id, reactionCount: reactions.length, reactions: reactions.map((reaction: any) => ({ id: reaction.stId, name: reaction.name, type: reaction.schemaClass, reversible: reaction.reversible, species: reaction.species?.[0]?.name, url: `https://reactome.org/content/detail/${reaction.stId}` })) }; return { content: [ { type: 'text', text: JSON.stringify(pathwayReactions, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting pathway reactions: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:296-302 (schema)Input schema defining the required 'id' parameter for the tool.inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Reactome pathway stable identifier' }, }, required: ['id'], },
- src/index.ts:293-303 (registration)Tool registration in the ListTools response, including name, description, and input schema.{ name: 'get_pathway_reactions', description: 'Get all biochemical reactions within a pathway', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Reactome pathway stable identifier' }, }, required: ['id'], }, },
- src/index.ts:339-340 (registration)Dispatcher case in the CallToolRequestSchema handler that routes to the specific handler function.case 'get_pathway_reactions': return this.handleGetPathwayReactions(args);