find_related_content
Discover related projects, tasks, or documents by analyzing relationships like similarity, dependencies, links, and recency within the Helios-9 project management system.
Instructions
Find content related to a specific entity (project, task, or document)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_type | Yes | Type of entity to find related content for | |
| entity_id | Yes | ID of the entity | |
| relation_types | No | Types of relationships to find | |
| max_results | No | Maximum number of related items to return |
Implementation Reference
- src/tools/context-aggregation.ts:349-378 (handler)Main handler function for the 'find_related_content' tool. Validates input using FindRelatedContentSchema, fetches source entity, finds relationships by type using helper functions, analyzes relationships, generates suggestions, and returns structured related content.export const findRelatedContent = requireAuth(async (args: any) => { const { entity_type, entity_id, relation_types, max_results } = FindRelatedContentSchema.parse(args) logger.info('Finding related content', { entity_type, entity_id, relation_types }) const relatedContent: any = { source_entity: await getSourceEntity(entity_type, entity_id), relationships: {} } for (const relationType of relation_types) { try { relatedContent.relationships[relationType] = await findRelationshipsByType( entity_type, entity_id, relationType, max_results ) } catch (error) { logger.error(`Error finding ${relationType} relationships:`, error) relatedContent.relationships[relationType] = [] } } // Calculate relationship strength and add metadata relatedContent.analysis = analyzeRelationships(relatedContent.relationships) relatedContent.suggestions = generateRelationshipSuggestions(relatedContent) return relatedContent })
- Zod schema defining input validation for the find_related_content tool: entity_type (project/task/document), entity_id (UUID), relation_types array, max_results.const FindRelatedContentSchema = z.object({ entity_type: z.enum(['project', 'task', 'document']), entity_id: z.string().uuid(), relation_types: z.array(z.enum(['similar', 'dependent', 'linked', 'recent'])).default(['similar', 'linked']), max_results: z.number().int().positive().max(50).default(10) })
- src/tools/context-aggregation.ts:310-345 (registration)MCPTool registration for 'find_related_content' including name, description, and JSON input schema matching the Zod schema.export const findRelatedContentTool: MCPTool = { name: 'find_related_content', description: 'Find content related to a specific entity (project, task, or document)', inputSchema: { type: 'object', properties: { entity_type: { type: 'string', enum: ['project', 'task', 'document'], description: 'Type of entity to find related content for' }, entity_id: { type: 'string', format: 'uuid', description: 'ID of the entity' }, relation_types: { type: 'array', items: { type: 'string', enum: ['similar', 'dependent', 'linked', 'recent'] }, default: ['similar', 'linked'], description: 'Types of relationships to find' }, max_results: { type: 'number', minimum: 1, maximum: 50, default: 10, description: 'Maximum number of related items to return' } }, required: ['entity_type', 'entity_id'] } }
- src/tools/context-aggregation.ts:724-730 (registration)Registration of tool handlers in contextAggregationHandlers object, mapping 'find_related_content' to the findRelatedContent handler function.export const contextAggregationHandlers = { get_smart_context: getSmartContext, get_workspace_overview: getWorkspaceOverview, get_project_insights: getProjectInsights, find_related_content: findRelatedContent, generate_context_summary: generateContextSummary }
- Internal helper function used within getSmartContext for finding related content across results, though stubbed implementation.async function findRelatedContentInternal(results: any, queryAnalysis: any): Promise<any> { // Find connections between different types of content const related = { cross_references: [], common_topics: [], related_projects: [] } // This would implement more sophisticated relationship finding return related }