Skip to main content
Glama
guillelagoria

DOOR Knowledge MCP Server

search_door_knowledge

Search DOOR support documentation and knowledge base articles by keywords, categories, or content to find relevant documents with summaries.

Instructions

Busca documentos en la DOOR Knowledge Base por palabras clave, categorías o contenido. Retorna una lista de documentos relevantes con resúmenes. Es MUY RÁPIDO porque usa un índice pre-generado.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesTérmino de búsqueda (ej: "installation", "latch m", "intercom", "wiring")
categoryNoFiltrar por categoría específica (opcional). Usa list_door_categories para ver las disponibles.
limitNoNúmero máximo de resultados (default: 10)

Implementation Reference

  • Main handler function for the 'search_door_knowledge' MCP tool. Parses arguments, loads search index, filters documents by query and optional category using keyword matching, scores relevance, limits results, formats a markdown response with document previews, or no-results message.
    async searchDoorKnowledge(args) {
      const { query, category, limit = 10 } = args;
      const index = await this.loadSearchIndex();
    
      const searchTerm = query.toLowerCase();
      let results = index.documents.filter(doc => {
        // Filtrar por categoría si se especifica
        if (category && doc.category.toLowerCase() !== category.toLowerCase()) {
          return false;
        }
        // Buscar en keywords
        return doc.keywords.includes(searchTerm);
      });
    
      // Ordenar por relevancia (número de coincidencias)
      results = results
        .map(doc => {
          const matches = (doc.keywords.match(new RegExp(searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi')) || []).length;
          return { ...doc, relevance: matches };
        })
        .sort((a, b) => b.relevance - a.relevance)
        .slice(0, limit);
    
      if (results.length === 0) {
        return {
          content: [
            {
              type: 'text',
              text: `No se encontraron resultados para: "${query}"\n\nIntenta con otros términos o usa list_door_categories para ver las categorías disponibles.`,
            },
          ],
        };
      }
    
      // Formatear resultados de manera concisa
      let response = `🔍 Encontrados ${results.length} resultados para: "${query}"\n\n`;
    
      results.forEach((doc, i) => {
        response += `${i + 1}. **${doc.title}**\n`;
        response += `   📁 ${doc.category}${doc.subcategory ? ` > ${doc.subcategory}` : ''}\n`;
        response += `   📄 ID: \`${doc.id}\` | ${doc.pages} páginas\n`;
        if (doc.summary) {
          response += `   📝 ${doc.summary.substring(0, 150)}${doc.summary.length > 150 ? '...' : ''}\n`;
        }
        response += `\n`;
      });
    
      response += `\n💡 Usa get_door_document con el ID para ver el contenido completo.`;
    
      return {
        content: [
          {
            type: 'text',
            text: response,
          },
        ],
      };
    }
  • Input schema definition for the search_door_knowledge tool, specifying query (required string), optional category and limit parameters.
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Término de búsqueda (ej: "installation", "latch m", "intercom", "wiring")',
        },
        category: {
          type: 'string',
          description: 'Filtrar por categoría específica (opcional). Usa list_door_categories para ver las disponibles.',
        },
        limit: {
          type: 'number',
          description: 'Número máximo de resultados (default: 10)',
          default: 10,
        },
      },
      required: ['query'],
    },
  • Registration of the search_door_knowledge tool in the MCP server's tool list (ListToolsRequestSchema handler) including name, description, and schema. Also shows the dispatch in CallToolRequestSchema handler that routes to the searchDoorKnowledge method.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'search_door_knowledge',
          description: 'Busca documentos en la DOOR Knowledge Base por palabras clave, categorías o contenido. Retorna una lista de documentos relevantes con resúmenes. Es MUY RÁPIDO porque usa un índice pre-generado.',
          inputSchema: {
            type: 'object',
            properties: {
              query: {
                type: 'string',
                description: 'Término de búsqueda (ej: "installation", "latch m", "intercom", "wiring")',
              },
              category: {
                type: 'string',
                description: 'Filtrar por categoría específica (opcional). Usa list_door_categories para ver las disponibles.',
              },
              limit: {
                type: 'number',
                description: 'Número máximo de resultados (default: 10)',
                default: 10,
              },
            },
            required: ['query'],
          },
        },
        {
          name: 'get_door_document',
          description: 'Obtiene el contenido completo de un documento específico de la DOOR Knowledge Base. Usa el ID obtenido de search_door_knowledge.',
          inputSchema: {
            type: 'object',
            properties: {
              document_id: {
                type: 'string',
                description: 'ID del documento (obtenido de search_door_knowledge)',
              },
            },
            required: ['document_id'],
          },
        },
        {
          name: 'list_door_categories',
          description: 'Lista todas las categorías y subcategorías disponibles en la DOOR Knowledge Base con conteo de documentos.',
          inputSchema: {
            type: 'object',
            properties: {},
          },
        },
      ],
    }));
    
    // Manejar llamadas a herramientas
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        switch (request.params.name) {
          case 'search_door_knowledge':
            return await this.searchDoorKnowledge(request.params.arguments);
  • Helper function to load the pre-built search index JSON from disk on demand, caching it in memory for fast subsequent access.
    async loadSearchIndex() {
      if (!this.searchIndex) {
        try {
          const data = await fs.readFile(this.searchIndexPath, 'utf-8');
          this.searchIndex = JSON.parse(data);
        } catch (err) {
          throw new Error(`No se pudo cargar el índice de búsqueda. Ejecuta: npm run build-index\nError: ${err.message}`);
        }
      }
      return this.searchIndex;
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden and adds valuable behavioral context: it discloses that the tool is 'MUY RÁPIDO porque usa un índice pre-generado' (performance characteristic) and describes the return format ('lista de documentos relevantes con resúmenes'). It doesn't cover aspects like error handling or authentication needs, but provides useful operational insights.

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 efficiently structured in two sentences: the first states purpose and methods, the second adds performance context and return format. Every sentence earns its place with no wasted words, and key information is front-loaded.

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 search tool with no annotations and no output schema, the description is reasonably complete: it covers purpose, methods, performance, and return format. However, it doesn't specify what 'documentos relevantes' entails (e.g., ranking criteria) or error scenarios, leaving some gaps in operational context.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain how 'query' interacts with 'category' or provide search syntax examples). Baseline 3 is appropriate when the schema does the heavy lifting.

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 specific action ('Busca documentos') and resource ('en la DOOR Knowledge Base'), with distinct search methods ('por palabras clave, categorías o contenido') that differentiate it from sibling tools like 'get_door_document' (which presumably retrieves a specific document) and 'list_door_categories' (which lists categories).

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (searching documents by keywords, categories, or content) and implicitly references 'list_door_categories' for available categories in the input schema. However, it lacks explicit guidance on when NOT to use it or direct alternatives to sibling tools.

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/guillelagoria/door-support-mcp'

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