Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

find_related_content

Discover content related to projects, tasks, or documents by identifying similar, dependent, linked, or recent items to enhance context and connections.

Instructions

Find content related to a specific entity (project, task, or document)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeYesType of entity to find related content for
entity_idYesID of the entity
relation_typesNoTypes of relationships to find
max_resultsNoMaximum number of related items to return

Implementation Reference

  • Main handler function that executes the find_related_content tool logic. Parses input using schema, fetches source entity, finds relationships by type, analyzes them, 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 parameters: entity_type, entity_id, relation_types, and 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)
    })
  • MCPTool object registration for find_related_content, including name, description, and JSON schema for input validation.
    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']
      }
    }
  • Handler registry mapping the snake_case tool name 'find_related_content' to its 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 for finding related content, used within getSmartContext tool (not directly in find_related_content).
    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
    }
  • Tool registry exporting the findRelatedContentTool MCPTool object.
    export const contextAggregationTools = {
      getSmartContextTool,
      getWorkspaceOverviewTool,
      getProjectInsightsTool,
      findRelatedContentTool,
      generateContextSummaryTool
    }

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

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