Skip to main content
Glama

count_skills

Counts the total number of reusable skills available in the Hivemind MCP knowledge base to assess available debugging resources.

Instructions

Get total count of skills in the database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the count_skills tool logic by fetching the total count of skills (entries where type='skill') from the Supabase backend API.
    export async function countSkills(): Promise<{ total: number }> { const response = await fetch(`${API_BASE}/count-skills`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({}), }); if (!response.ok) { throw new Error(`Count skills failed: ${response.statusText}`); } return response.json(); }
  • Input/output schema definition for the count_skills tool. No input parameters required.
    { name: "count_skills", description: "Get total count of skills in the database.", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:401-406 (registration)
    Registration of the count_skills handler in the MCP CallToolRequestSchema switch statement.
    case "count_skills": { const result = await countSkills(); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
  • Backend API handler for /count-skills endpoint, which performs the actual database query to count skills (knowledge_entries where type='skill'). Called by the MCP client's countSkills function.
    async function handleCountSkills(supabase: any, corsHeaders: any) { const { count, error } = await supabase .from('knowledge_entries') .select('*', { count: 'exact', head: true }) .eq('type', 'skill'); if (error) { console.error('Count skills error:', error); return new Response(JSON.stringify({ error: 'Count failed' }), { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }); } return new Response(JSON.stringify({ total: count || 0 }), { headers: { ...corsHeaders, 'Content-Type': 'application/json' } }); }
  • Registration of the count-skills route handler in the Supabase public gateway switch statement.
    case 'count-skills': return await handleCountSkills(supabase, corsHeaders);

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