Skip to main content
Glama

search_skills

Find relevant skills by topic or keyword in the Hivemind MCP knowledge base, returning summaries to identify useful solutions.

Instructions

Search for skills by topic/keyword. Returns lightweight summaries - use get_skill() for full details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesTopic or keyword to search for (e.g., 'deployment', 'testing', 'CI/CD')

Implementation Reference

  • Primary handler function for search_skills tool. Performs HTTP POST to backend /search-skills endpoint with query, returns SkillSearchResult.
    export async function searchSkills(query: string, maxResults: number = 20): Promise<SkillSearchResult> {
      const response = await fetch(`${API_BASE}/search-skills`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ query, max_results: maxResults }),
      });
    
      if (!response.ok) {
        throw new Error(`Search skills failed: ${response.statusText}`);
      }
    
      return response.json();
    }
  • MCP tool schema definition: name, description, and inputSchema requiring 'query' string parameter.
    {
      name: "search_skills",
      description:
        "Search for skills by topic/keyword. Returns lightweight summaries - use get_skill() for full details.",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Topic or keyword to search for (e.g., 'deployment', 'testing', 'CI/CD')",
          },
        },
        required: ["query"],
      },
    },
  • MCP server CallToolRequest handler dispatches search_skills calls to searchSkills function and returns JSON response.
    case "search_skills": {
      const result = await searchSkills(args?.query as string);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
  • Backend Supabase edge function handler for /search-skills. Executes PostgreSQL RPC search_knowledge filtered to type='skill', maps to lightweight skill objects (id, title, category, preview, relevance), handles errors and rate limits.
    async function handleSearchSkills(supabase: any, body: any, corsHeaders: any) {
      const { query, max_results = 20 } = body;
    
      if (!query) {
        return new Response(JSON.stringify({ error: 'query parameter required' }), {
          status: 400,
          headers: { ...corsHeaders, 'Content-Type': 'application/json' }
        });
      }
    
      const startTime = performance.now();
    
      // Cap at 50 to prevent huge responses
      const cappedLimit = Math.min(max_results, 50);
    
      // Use FTS search filtered to skills only
      const { data: results, error } = await supabase.rpc('search_knowledge', {
        search_query: query,
        result_limit: cappedLimit,
        type_filter: 'skill'
      });
    
      if (error) {
        console.error('Skills search error:', error);
        return new Response(JSON.stringify({ error: 'Search failed' }), {
          status: 500,
          headers: { ...corsHeaders, 'Content-Type': 'application/json' }
        });
      }
    
      const searchTime = performance.now() - startTime;
    
      // Return lightweight summaries only (no full solutions array)
      const skills = (results || []).map((r: any) => ({
        id: r.id,
        title: r.query,
        category: r.category,
        // Just first solution as preview, not the full array
        preview: r.solutions?.[0]?.solution?.substring(0, 150) + '...' || '',
        relevance: r.search_rank ? Math.abs(r.search_rank) : 0.5
      }));
    
      return new Response(JSON.stringify({
        query,
        skills,
        total: skills.length,
        tip: skills.length > 0 ? `Use get_skill(${skills[0].id}) to see full details` : 'No matching skills found',
        query_metadata: {
          search_method: 'postgres_fts',
          search_time_ms: Math.round(searchTime * 100) / 100
        },
        _ctx: "SEARCH FIRST: Check available skills before building custom solutions."
      }), {
        headers: { ...corsHeaders, 'Content-Type': 'application/json' }
      });
    }
  • TypeScript interface defining the expected output structure of searchSkills (SkillSearchResult).
    interface SkillSearchResult {
      query: string;
      skills: Array<{
        id: number;
        title: string;
        category: string;
        preview: string;
        relevance: number;
      }>;
      total: number;
      tip: string;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return format ('lightweight summaries') which is valuable context beyond the input schema. However, it doesn't address important behavioral aspects like pagination, rate limits, authentication requirements, error conditions, or what constitutes a 'lightweight summary' versus full details.

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

Conciseness5/5

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

The description is perfectly concise and well-structured in just two sentences. The first sentence states the core purpose, the second provides crucial usage guidance. Every word earns its place with zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with no annotations and no output schema, the description provides adequate but incomplete context. It covers the basic purpose and distinguishes from one sibling, but doesn't explain the return format in detail, error handling, or how results are structured. Given the complexity of search operations and lack of output schema, more completeness would be beneficial.

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 description coverage is 100%, so the input schema already fully documents the single 'query' parameter. The description adds no additional parameter semantics beyond what's in the schema. The baseline score of 3 is appropriate when the schema does all the parameter documentation work.

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 purpose: 'Search for skills by topic/keyword' specifies both the verb (search) and resource (skills). It distinguishes from sibling 'get_skill' by mentioning it returns 'lightweight summaries' versus full details. However, it doesn't explicitly differentiate from other search siblings like 'search_kb' or 'search_project'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool versus an alternative: 'use get_skill() for full details' explicitly names the alternative tool for detailed information. However, it doesn't specify when NOT to use this tool or mention other potential alternatives among siblings like 'search_kb' or 'search_project'.

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/Kevthetech143/hivemind-mcp'

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