Skip to main content
Glama
vuluu2k
by vuluu2k

searchKnowledge

Find information across knowledge topics by searching with keywords. Returns matching entries with topic, title, and content details.

Instructions

Search across all knowledge topics by keyword. Returns matching entries with their topic, title, and content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keyword or phrase

Implementation Reference

  • The actual implementation of the searchKnowledge logic that parses and searches through topic files in the knowledge base.
    async searchKnowledge(query: string): Promise<SearchHit[]> {
      const log = getLogger();
      const topics = await this.listTopics();
      if (topics.length === 0) return [];
    
      const lower = query.toLowerCase();
      const hits: SearchHit[] = [];
    
      // Read all topic files in parallel (cached after first read)
      const files = await Promise.all(
        topics.map(async (topic) => {
          try {
            const file = await this.client.getFile(this.topicPath(topic));
            return { topic, content: file.content };
          } catch {
            return null;
          }
        })
      );
    
      for (const f of files) {
        if (!f) continue;
        const entries = parseEntries(f.content);
        for (const entry of entries) {
          if (
            entry.title.toLowerCase().includes(lower) ||
            entry.content.toLowerCase().includes(lower)
          ) {
            hits.push({ topic: f.topic, title: entry.title, content: entry.content });
          }
        }
      }
    
      log.info("searchKnowledge", { query, hits: hits.length, topicsScanned: topics.length });
      return hits;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return format ('matching entries with their topic, title, and content'), which adds some value, but it lacks details on permissions, rate limits, pagination, or error handling. For a search tool with zero annotation coverage, this is a significant gap in transparency.

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 concise and front-loaded, consisting of two clear sentences that state the action and the return value. There is no wasted verbiage, and it efficiently communicates the core functionality. However, it could be slightly improved by integrating usage guidance, but as is, it's well-structured.

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?

Given the tool's low complexity (one parameter, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose and return format, but lacks details on behavioral aspects like search scope (e.g., fuzzy matching, case sensitivity) and error cases. Without an output schema, it should ideally explain return values more thoroughly, but it does the bare minimum for a simple search tool.

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?

The schema description coverage is 100%, with the single parameter 'query' well-documented in the schema as 'Search keyword or phrase.' The description adds no additional semantic context beyond implying keyword-based searching. Given the high schema coverage, a baseline score of 3 is appropriate, as the description doesn't enhance parameter understanding 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 purpose: 'Search across all knowledge topics by keyword.' It specifies the verb (search), resource (knowledge topics), and scope (all). However, it doesn't explicitly differentiate from sibling tools like 'getKnowledge' or 'listTopics,' which might offer similar functionality, so it doesn't reach the highest score.

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. With siblings like 'getKnowledge' and 'listTopics' present, it fails to specify scenarios where this search tool is preferred, such as for keyword-based filtering versus direct retrieval. This lack of comparative context limits its utility for an AI agent.

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/vuluu2k/knowledge_mcp'

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