Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

get_smart_context

Aggregate context from projects, tasks, and documents using natural language queries to find relevant information quickly.

Instructions

Get intelligent context aggregation based on natural language query across projects, tasks, and documents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language query describing what context you need (e.g., "authentication tasks", "API documentation", "blocked items")
project_idNoOptional project ID to scope the search
context_typesNoTypes of content to include in context
max_results_per_typeNoMaximum results to return per content type
include_relatedNoWhether to include related/linked content

Implementation Reference

  • The main handler function that executes the get_smart_context tool logic: parses input, analyzes query, fetches relevant projects/tasks/documents/conversations, finds related content, generates insights and a summary, and returns the aggregated context.
    export const getSmartContext = requireAuth(async (args: any) => {
      const { query, project_id, context_types, max_results_per_type, include_related } = GetSmartContextSchema.parse(args)
      
      logger.info('Getting smart context', { query, project_id, context_types })
    
      // Analyze query to understand intent and extract keywords
      const queryAnalysis = analyzeContextQuery(query)
      
      const context: any = {
        query_analysis: queryAnalysis,
        results: {},
        related_content: {},
        insights: {}
      }
    
      // Get relevant content for each requested type
      for (const type of context_types) {
        try {
          switch (type) {
            case 'projects':
              context.results.projects = await getRelevantProjects(queryAnalysis, project_id, max_results_per_type)
              break
            case 'tasks':
              context.results.tasks = await getRelevantTasks(queryAnalysis, project_id, max_results_per_type)
              break
            case 'documents':
              context.results.documents = await getRelevantDocuments(queryAnalysis, project_id, max_results_per_type)
              break
            case 'conversations':
              context.results.conversations = await getRelevantConversations(queryAnalysis, project_id, max_results_per_type)
              break
          }
        } catch (error) {
          logger.error(`Error getting ${type} context:`, error)
          context.results[type] = []
        }
      }
    
      // Get related content if requested
      if (include_related) {
        context.related_content = await findRelatedContentInternal(context.results, queryAnalysis)
      }
    
      // Generate insights and recommendations
      context.insights = generateContextInsights(context.results, queryAnalysis)
      context.summary = generateSmartContextSummary(context, query)
    
      logger.info('Smart context generated', { 
        query, 
        total_results: Object.values(context.results).flat().length 
      })
    
      return context
    })
  • Zod schema defining input validation for get_smart_context: query (required string), project_id (optional UUID), context_types (array with defaults), max_results_per_type (number with default 5), include_related (boolean, default true).
    const GetSmartContextSchema = z.object({
      query: z.string().min(1),
      project_id: z.string().uuid().optional(),
      context_types: z.array(z.enum(['projects', 'tasks', 'documents', 'conversations'])).default(['projects', 'tasks', 'documents']),
      max_results_per_type: z.number().int().positive().max(20).default(5),
      include_related: z.boolean().default(true)
    })
  • MCPTool registration object for get_smart_context: defines the tool name, description, and JSON Schema input schema that gets exposed via the MCP ListTools endpoint.
    export const getSmartContextTool: MCPTool = {
      name: 'get_smart_context',
      description: 'Get intelligent context aggregation based on natural language query across projects, tasks, and documents',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Natural language query describing what context you need (e.g., "authentication tasks", "API documentation", "blocked items")'
          },
          project_id: {
            type: 'string',
            format: 'uuid',
            description: 'Optional project ID to scope the search'
          },
          context_types: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['projects', 'tasks', 'documents', 'conversations']
            },
            default: ['projects', 'tasks', 'documents'],
            description: 'Types of content to include in context'
          },
          max_results_per_type: {
            type: 'number',
            minimum: 1,
            maximum: 20,
            default: 5,
            description: 'Maximum results to return per content type'
          },
          include_related: {
            type: 'boolean',
            default: true,
            description: 'Whether to include related/linked content'
          }
        },
        required: ['query']
      }
    }
  • Handler export map that maps the tool name 'get_smart_context' to its handler function, which is then merged in src/index.ts into the allHandlers object used by the CallToolRequest handler.
    export const contextAggregationHandlers = {
      get_smart_context: getSmartContext,
      get_workspace_overview: getWorkspaceOverview,
      get_project_insights: getProjectInsights,
      find_related_content: findRelatedContent,
      generate_context_summary: generateContextSummary
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully inform behavioral expectations. It mentions aggregating across types but omits details about return format, pagination, or how the query is processed. The phrase 'intelligent context aggregation' lacks concrete behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single concise sentence conveys the core purpose without superfluous text. However, it could be structured with bullet points or separated sections for improved skimmability.

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 5 parameters and no output schema, the description is too brief. It does not explain what the result looks like, how 'max_results_per_type' affects output, or how to interpret 'intelligent' aggregation.

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 coverage is 100%, so baseline is 3. The description does not add meaningful detail beyond the schema's parameter descriptions, such as clarifying the role of 'include_related' or 'context_types' in aggregation.

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 aggregates context across projects, tasks, and documents using natural language queries. It distinguishes from siblings like 'semantic_search' (search-focused) and 'get_workspace_context' (workspace-specific), but the term 'intelligent context aggregation' remains somewhat vague.

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?

No guidance is provided on when to use this tool versus alternative context/search tools such as 'universal_search' or 'get_enhanced_project_context'. The description does not specify exclusions or prerequisites.

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

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