Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

get_search_suggestions

Get autocomplete suggestions for search queries, including recent searches, popular terms, related concepts, and entity suggestions, based on a partial input and optional project context.

Instructions

Get intelligent search suggestions and autocomplete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partial_queryYesPartial search query for autocomplete
suggestion_typesNoTypes of suggestions to return
context_project_idNoProject context for better suggestions
max_suggestionsNoMaximum number of suggestions

Implementation Reference

  • Main handler function for get_search_suggestions. Parses input with Zod schema, then dispatches to sub-functions (getRecentSearches, getPopularSearchTerms, getRelatedConcepts, getEntitySuggestions) based on requested suggestion_types. Returns an object with partial_query, suggestions (grouped by type), and total_suggestions.
    export const getSearchSuggestions = requireAuth(async (args: any) => {
      const { partial_query, suggestion_types, context_project_id, max_suggestions } = GetSearchSuggestionsSchema.parse(args)
      
      logger.info('Getting search suggestions', { partial_query, suggestion_types })
    
      const suggestions: any = {
        partial_query,
        suggestions: {},
        total_suggestions: 0
      }
    
      for (const suggestionType of suggestion_types) {
        try {
          let typeSuggestions: any[] = []
          
          switch (suggestionType) {
            case 'recent_searches':
              typeSuggestions = await getRecentSearches(partial_query, context_project_id)
              break
            case 'popular_terms':
              typeSuggestions = await getPopularSearchTerms(partial_query, context_project_id)
              break
            case 'related_concepts':
              typeSuggestions = await getRelatedConcepts(partial_query, context_project_id)
              break
            case 'entity_suggestions':
              typeSuggestions = await getEntitySuggestions(partial_query, context_project_id)
              break
          }
    
          suggestions.suggestions[suggestionType] = typeSuggestions.slice(0, max_suggestions)
          suggestions.total_suggestions += typeSuggestions.length
        } catch (error) {
          logger.error(`Failed to get suggestions for ${suggestionType}:`, error)
          suggestions.suggestions[suggestionType] = []
        }
      }
    
      return suggestions
    })
  • Zod schema for validating the tool's input parameters: partial_query (required string), suggestion_types (enum array with default), context_project_id (optional string), max_suggestions (number 1-20, default 10).
    const GetSearchSuggestionsSchema = z.object({
      partial_query: z.string().min(1),
      suggestion_types: z.array(z.enum(['recent_searches', 'popular_terms', 'related_concepts', 'entity_suggestions'])).default(['recent_searches', 'popular_terms', 'entity_suggestions']),
      context_project_id: z.string().optional(),
      max_suggestions: z.number().min(1).max(20).default(10)
    })
  • Tool definition/registration object (getSearchSuggestionsTool) with name 'get_search_suggestions', description, and inputSchema for the MCP protocol. Exported and collected in the intelligentSearchTools and intelligentSearchHandlers maps.
    export const getSearchSuggestionsTool: MCPTool = {
      name: 'get_search_suggestions',
      description: 'Get intelligent search suggestions and autocomplete',
      inputSchema: {
        type: 'object',
        properties: {
          partial_query: {
            type: 'string',
            description: 'Partial search query for autocomplete'
          },
          suggestion_types: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['recent_searches', 'popular_terms', 'related_concepts', 'entity_suggestions']
            },
            default: ['recent_searches', 'popular_terms', 'entity_suggestions'],
            description: 'Types of suggestions to return'
          },
          context_project_id: {
            type: 'string',
            description: 'Project context for better suggestions'
          },
          max_suggestions: {
            type: 'number',
            minimum: 1,
            maximum: 20,
            default: 10,
            description: 'Maximum number of suggestions'
          }
        },
        required: ['partial_query']
      }
    }
  • Export of intelligentSearchHandlers mapping the tool name 'get_search_suggestions' to the getSearchSuggestions handler function, which gets merged into the server's tool handler registry in src/index.ts.
    export const intelligentSearchHandlers = {
      universal_search: universalSearch,
      semantic_search: semanticSearch,
      get_search_suggestions: getSearchSuggestions,
      get_search_analytics: getSearchAnalytics
    }
  • getRecentSearches helper - placeholder returning mock suggestions based on partial query.
    async function getRecentSearches(partialQuery: string, projectId?: string): Promise<string[]> {
      // Placeholder - would query search history
      return [`${partialQuery} api`, `${partialQuery} documentation`]
    }
  • getPopularSearchTerms helper - placeholder filtering a static list of popular terms.
    async function getPopularSearchTerms(partialQuery: string, projectId?: string): Promise<string[]> {
      // Placeholder - would return popular terms
      return ['authentication', 'database', 'frontend', 'backend']
        .filter(term => term.includes(partialQuery.toLowerCase()))
  • getRelatedConcepts helper - placeholder returning empty array.
    async function getRelatedConcepts(partialQuery: string, projectId?: string): Promise<string[]> {
      // Placeholder - would return semantically related concepts
      return []
  • getEntitySuggestions helper - queries supabaseService.getProjects to find project names matching the partial query.
    async function getEntitySuggestions(partialQuery: string, projectId?: string): Promise<string[]> {
      // Search for project names, task titles, etc. that match
      const suggestions = []
      
      try {
        const projects = await supabaseService.getProjects({ search: partialQuery }, { limit: 5 })
        suggestions.push(...projects.map(p => p.name))
      } catch (error) {
        logger.error('Error getting entity suggestions:', error)
      }
      
      return suggestions
    }
Behavior2/5

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

No annotations are present, so the description carries full burden. It only states 'intelligent search suggestions' without mentioning any side effects, permissions, or limitations. For a tool that may record recent searches, this lack of transparency is a gap.

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?

The description is very concise (one sentence) and to the point. It is appropriately short for its purpose, though it could benefit from slightly more detail.

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?

With no output schema and 4 parameters, the description is incomplete. It does not describe return structure, how parameters affect results, or any constraints. The tool's complexity demands more context.

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 the baseline is 3. The description adds no additional parameter information beyond what the schema already provides.

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's function (getting suggestions/autocomplete). It is a specific verb+resource. However, it does not explicitly distinguish from siblings like universal_search or semantic_search, which could be considered overlapping.

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 alternatives (e.g., search_workspace, semantic_search). The description gives no context for appropriate usage or exclusions.

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