Skip to main content
Glama

search_knowledge_base

Read-onlyIdempotent

Find relevant knowledge base articles by querying keywords or error messages. Supports multiple ITSM systems including Jira, ServiceNow, and Zendesk.

Instructions

Search the knowledge base for articles related to an issue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query — keywords, error messages, or topic
limitNoMax articles to return
systemNoITSM system to usejira

Implementation Reference

  • The business logic handler function for search_knowledge_base. Filters in-memory knowledgeBaseArticles array by matching the query against title, summary, or tags, and returns up to `limit` results.
    function searchKnowledgeBase({ query, limit = 5 }) {
      const q = query.toLowerCase();
      const results = knowledgeBaseArticles
        .filter(a => a.title.toLowerCase().includes(q) || a.summary.toLowerCase().includes(q) || a.tags.some(t => t.includes(q)))
        .slice(0, limit);
      return { success: true, articles: results, total: results.length };
    }
  • index.js:312-331 (registration)
    MCP tool registration for 'search_knowledge_base' using server.tool(). Defines the schema (query, limit, optional system), annotations (read-only, idempotent), and the async handler that calls searchKnowledgeBase().
    server.tool(
      'search_knowledge_base',
      'Search the knowledge base for articles related to an issue',
      {
        query: z.string().describe('Search query — keywords, error messages, or topic'),
        limit: z.number().int().min(1).max(20).default(5).describe('Max articles to return'),
        system: systemSchema.optional(),
      },
      {
        title: 'Search Knowledge Base',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
      async ({ query, limit }) => {
        const result = searchKnowledgeBase({ query, limit });
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      },
    );
  • Zod input schema for the search_knowledge_base tool: query (string), limit (int 1-20, default 5), optional system.
    {
      query: z.string().describe('Search query — keywords, error messages, or topic'),
      limit: z.number().int().min(1).max(20).default(5).describe('Max articles to return'),
      system: systemSchema.optional(),
    },
  • The in-memory knowledge base data store used by searchKnowledgeBase(). Contains 5 hardcoded KB articles with id, title, summary, url, and tags.
    const knowledgeBaseArticles = [
      {
        id: 'KB-001',
        title: 'How to reset your password',
        summary: 'Step-by-step guide to reset your password',
        url: 'https://example.com/kb/password-reset',
        tags: ['password', 'authentication', 'login'],
      },
      {
        id: 'KB-002',
        title: 'Common login issues',
        summary: 'Troubleshooting common login problems',
        url: 'https://example.com/kb/login-issues',
        tags: ['login', 'authentication', 'troubleshooting'],
      },
      {
        id: 'KB-003',
        title: 'Setting up email on mobile devices',
        summary: 'How to configure email on iOS and Android',
        url: 'https://example.com/kb/email-setup',
        tags: ['email', 'mobile', 'configuration'],
      },
      {
        id: 'KB-004',
        title: 'VPN connection troubleshooting',
        summary: 'Fixing common VPN connection problems',
        url: 'https://example.com/kb/vpn-issues',
        tags: ['vpn', 'network', 'troubleshooting'],
      },
      {
        id: 'KB-005',
        title: 'Printer setup guide',
        summary: 'How to install and configure network printers',
        url: 'https://example.com/kb/printer-setup',
        tags: ['printer', 'hardware', 'configuration'],
      },
    ];
Behavior3/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false. The description adds no further behavioral details beyond the search action, such as authentication needs or result format. No contradiction with annotations.

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 a single, clear sentence with no wasted words. It could be slightly expanded to include when to use, but it is appropriately front-loaded and efficient.

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?

Given the simple nature of the tool (search with query, limit, system), the description is sufficient. No output schema exists, but the tool's behavior is straightforward and well-covered by annotations and schema.

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?

All three parameters have descriptive schema documentation (100% coverage). The description does not add meaning beyond what the schema already provides, so baseline 3 is appropriate.

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 verb 'search' and the resource 'knowledge base' with a specific goal: finding articles related to an issue. It distinguishes itself from sibling tools, which are all ticket-related actions.

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

Usage Guidelines3/5

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

The description implies usage when articles about an issue are needed, but does not explicitly state when to use or not use this tool, nor does it mention alternative tools or context for exclusion.

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/madosh/MCP-ITSM'

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