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);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
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 disclosing behavior. It states a simple read operation ('Get total count'), which is inherently non-destructive, but does not disclose any additional behavioral traits such as performance implications, whether the count includes all skills globally, or how the result is returned. The description is minimal but sufficient for a trivially simple operation.

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 a single sentence that is direct and front-loaded, containing no wasted words. It communicates the essential purpose without any filler.

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

Completeness4/5

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

For a tool with no parameters, no output schema, and a simple count operation, the description is nearly complete. It tells the agent exactly what the tool does. However, it does not specify the exact return format (e.g., a bare integer vs. a JSON object), though this is a minor gap given the simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema covers 100% of its (non-existent) properties. With no parameters to describe, the description does not need to add any parameter semantics. The baseline for zero parameters is 4, and the description does not introduce confusion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and the resource ('skills'), and specifies the result ('total count'). It is concise and unambiguous, distinguishing itself from sibling tools like search_skills and get_skill by focusing specifically on counting rather than retrieving or searching.

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?

The description provides no guidance on when to use this tool versus alternatives. While the name implies it for counting, there is no explicit mention of when to prefer count_skills over search_skills, nor any exclusions or context. This leaves the agent to infer usage based on the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.