Skip to main content
Glama

find_pathways_by_disease

Identify biological pathways linked to a specific disease using Reactome's pathway data, facilitating research on disease mechanisms.

Instructions

Find disease-associated pathways and mechanisms

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diseaseYesDisease name or DOID identifier
sizeNoNumber of pathways to return (1-100, default: 25)

Implementation Reference

  • The main handler function that executes the find_pathways_by_disease tool logic: validates input with isValidDiseaseArgs, queries Reactome /search/query API for Pathway types matching the disease, extracts and limits results, formats with pathway details and URLs, returns JSON content or error.
    private async handleFindPathwaysByDisease(args: any) { if (!isValidDiseaseArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid disease arguments'); } try { // Search for disease-related pathways const searchResponse = await this.apiClient.get('/search/query', { params: { query: args.disease, types: 'Pathway', cluster: true } }); // Extract pathway entries from result groups let pathwayEntries: any[] = []; if (searchResponse.data.results) { for (const group of searchResponse.data.results) { if (group.typeName === 'Pathway' && group.entries) { pathwayEntries = pathwayEntries.concat(group.entries); } } } // Limit results if specified if (args.size) { pathwayEntries = pathwayEntries.slice(0, args.size); } const diseasePathways = { disease: args.disease, pathwayCount: pathwayEntries.length, pathways: pathwayEntries.map((pathway: any) => ({ id: pathway.stId || pathway.id, name: pathway.name?.replace(/<[^>]*>/g, '') || 'Unknown', type: pathway.exactType || pathway.typeName || 'Unknown', species: Array.isArray(pathway.species) ? pathway.species[0] : pathway.species || 'Unknown', description: (pathway.summation?.substring(0, 200) || 'No description available') + '...', url: `https://reactome.org/content/detail/${pathway.stId || pathway.id}` })) }; return { content: [ { type: 'text', text: JSON.stringify(diseasePathways, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error finding pathways by disease: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • Input schema definition for the tool, specifying object with required 'disease' string and optional 'size' number (1-100).
    inputSchema: { type: 'object', properties: { disease: { type: 'string', description: 'Disease name or DOID identifier' }, size: { type: 'number', description: 'Number of pathways to return (1-100, default: 25)', minimum: 1, maximum: 100 }, }, required: ['disease'], },
  • src/index.ts:259-270 (registration)
    Tool registration in ListToolsRequestSchema handler: defines name, description, and inputSchema.
    { name: 'find_pathways_by_disease', description: 'Find disease-associated pathways and mechanisms', inputSchema: { type: 'object', properties: { disease: { type: 'string', description: 'Disease name or DOID identifier' }, size: { type: 'number', description: 'Number of pathways to return (1-100, default: 25)', minimum: 1, maximum: 100 }, }, required: ['disease'], }, },
  • src/index.ts:333-334 (registration)
    Switch case in CallToolRequestSchema handler that dispatches tool calls to the handler method.
    case 'find_pathways_by_disease': return this.handleFindPathwaysByDisease(args);
  • Helper type guard function to validate find_pathways_by_disease tool arguments before execution.
    const isValidDiseaseArgs = (args: any): args is { disease: string; size?: number } => { return ( typeof args === 'object' && args !== null && typeof args.disease === 'string' && args.disease.length > 0 && (args.size === undefined || (typeof args.size === 'number' && args.size > 0 && args.size <= 100)) ); };

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/Reactome-MCP-Server'

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