Skip to main content
Glama
rad-security

RAD Security

Official
by rad-security

search_knowledge_base

Search organizational documents, procedures, and reports using natural language queries to find relevant security information.

Instructions

Search your organization's knowledge base to find relevant uploaded documents, procedures, reports, and other content using natural language queries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language question or keywords to search for across your uploaded knowledge base content. Can be a full question, technical terms, or key phrases.
top_kNoMaximum number of most relevant document excerpts to return. Use higher values (10-20) for comprehensive research, lower values (3-5) for focused answers. Default: 5
min_scoreNoMinimum semantic similarity score threshold (0.0 to 1.0). Higher values (0.8-1.0) return only highly relevant matches, lower values (0.5-0.7) include broader context. Default: 0.5
thread_idNoThread identifier for the current conversation or session. IMPORTANT: If a thread_id is available in your context, you MUST provide it to include thread-specific documents alongside general knowledge base content. Only omit if no thread context exists.
collectionsNoOptional list of collection names to filter search results. Only documents tagged with these collections will be searched. Cannot be used with document_ids.
document_idsNoOptional list of specific document IDs to search within. Use this to restrict search to known documents. Cannot be used with collections.

Implementation Reference

  • MCP server CallToolRequest handler case that executes the search_knowledge_base tool by parsing arguments, calling the underlying searchKnowledgeBase function, and formatting the response as MCP content.
    case "search_knowledge_base": {
      const args = knowledgeBase.SearchKnowledgeBaseSchema.parse(
        request.params.arguments
      );
      const response = await knowledgeBase.searchKnowledgeBase(
        client,
        args.query,
        args.top_k,
        args.min_score,
        args.thread_id,
        args.collections,
        args.document_ids
      );
      return {
        content: [
          { type: "text", text: JSON.stringify(response, null, 2) },
        ],
      };
    }
  • Zod schema definition for input validation of the search_knowledge_base tool.
    export const SearchKnowledgeBaseSchema = z.object({
      query: z.string().describe("Natural language question or keywords to search for across your uploaded knowledge base content. Can be a full question, technical terms, or key phrases."),
      top_k: z.number().optional().describe("Maximum number of most relevant document excerpts to return. Use higher values (10-20) for comprehensive research, lower values (3-5) for focused answers. Default: 5"),
      min_score: z.number().optional().describe("Minimum semantic similarity score threshold (0.0 to 1.0). Higher values (0.8-1.0) return only highly relevant matches, lower values (0.5-0.7) include broader context. Default: 0.5"),
      thread_id: z.string().optional().describe("Thread identifier for the current conversation or session. IMPORTANT: If a thread_id is available in your context, you MUST provide it to include thread-specific documents alongside general knowledge base content. Only omit if no thread context exists."),
      collections: z.array(z.string()).optional().describe("Optional list of collection names to filter search results. Only documents tagged with these collections will be searched. Cannot be used with document_ids."),
      document_ids: z.array(z.string()).optional().describe("Optional list of specific document IDs to search within. Use this to restrict search to known documents. Cannot be used with collections."),
    });
  • Core handler function that constructs the request body and calls the RAD Security API endpoint for searching the knowledge base.
    export async function searchKnowledgeBase(
      client: RadSecurityClient,
      query: string,
      topK?: number,
      minScore?: number,
      threadId?: string,
      collections?: string[],
      documentIds?: string[],
    ): Promise<any> {
      const tenantId = await client.getTenantId();
    
      const body: Record<string, any> = { query };
    
      if (topK !== undefined) {
        body.top_k = topK;
      }
    
      if (minScore !== undefined) {
        body.min_score = minScore;
      }
    
      if (threadId !== undefined) {
        body.thread_id = threadId;
      }
    
      if (collections !== undefined) {
        body.collections = collections;
      }
    
      if (documentIds !== undefined) {
        body.document_ids = documentIds;
      }
    
      return client.makeRequest(
        `/tenants/${tenantId}/accounts/${client.getAccountId()}/knowledge_base/search`,
        {},
        {
          method: "POST",
          body: body,
        }
      );
    }
  • src/index.ts:548-555 (registration)
    Tool registration in the MCP ListToolsRequest handler, defining the tool name, description, and input schema.
    {
      name: "search_knowledge_base",
      description:
        "Search your organization's knowledge base to find relevant uploaded documents, procedures, reports, and other content using natural language queries",
      inputSchema: zodToJsonSchema(
        knowledgeBase.SearchKnowledgeBaseSchema
      ),
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions searching 'uploaded documents, procedures, reports, and other content,' it doesn't describe important behavioral aspects like authentication requirements, rate limits, pagination behavior, error conditions, or what format the results will be returned in (especially critical without an output schema).

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, efficient sentence that clearly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality.

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?

For a search tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what kind of results to expect, how relevance is determined, whether results are ranked, or any limitations of the search functionality. The agent would need to guess about the return format and search behavior.

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%, providing comprehensive parameter documentation. The description adds no parameter-specific information beyond what's already in the schema. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 searches an organization's knowledge base using natural language queries, specifying the target resource and action. However, it doesn't differentiate from sibling tools like 'query_knowledge_base_document' or 'list_knowledge_base_documents', which appear to be related knowledge base operations.

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. It doesn't mention sibling tools like 'query_knowledge_base_document' or 'list_knowledge_base_documents', nor does it specify use cases, prerequisites, or exclusions for this search functionality.

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/rad-security/mcp-server'

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