Skip to main content
Glama
TocharianOU

Kibana MCP Server

by TocharianOU

search_kibana_api_paths

Filter and find Kibana API endpoints using a specific keyword to quickly locate relevant API paths on the Kibana MCP Server.

Instructions

Search Kibana API endpoints by keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesSearch keyword for filtering API endpoints

Implementation Reference

  • Registration of the 'search_kibana_api_paths' tool, including inline schema and handler function.
    server.tool(
      "search_kibana_api_paths",
      `Search Kibana API endpoints by keyword`,
      z.object({
        search: z.string().describe('Search keyword for filtering API endpoints')
      }),
      async ({ search }): Promise<ToolResponse> => {
        await buildApiIndex();
        const endpoints = searchApiEndpoints(search);
        return {
          content: [
            {
              type: "text",
              text: `Found ${endpoints.length} API endpoints: ${JSON.stringify(endpoints.map(e => ({
                method: e.method,
                path: e.path,
                summary: e.summary,
                description: e.description
              })), null, 2)}`
            }
          ]
        };
      }
    );
  • Handler logic: builds the API index if necessary and searches endpoints using the helper function, returning formatted results.
    async ({ search }): Promise<ToolResponse> => {
      await buildApiIndex();
      const endpoints = searchApiEndpoints(search);
      return {
        content: [
          {
            type: "text",
            text: `Found ${endpoints.length} API endpoints: ${JSON.stringify(endpoints.map(e => ({
              method: e.method,
              path: e.path,
              summary: e.summary,
              description: e.description
            })), null, 2)}`
          }
        ]
      };
    }
  • Zod input schema defining the 'search' parameter as a string.
    z.object({
      search: z.string().describe('Search keyword for filtering API endpoints')
    }),
  • Helper function that filters the global apiEndpointIndex array based on the query string matching path, description, summary, or tags.
    function searchApiEndpoints(query: string): ApiEndpoint[] {
      if (!isIndexBuilt) throw new Error('API index not built yet');
      const q = query.toLowerCase();
      return apiEndpointIndex.filter(e =>
        e.path.toLowerCase().includes(q) ||
        (e.description && e.description.toLowerCase().includes(q)) ||
        (e.summary && e.summary.toLowerCase().includes(q)) ||
        (e.tags && e.tags.some(tag => tag.toLowerCase().includes(q)))
      );
    }
  • Helper function that loads and parses the Kibana OpenAPI YAML file to build the global apiEndpointIndex used by the search tool.
    async function buildApiIndex(): Promise<void> {
      if (isIndexBuilt) return;
      
      // Enhanced path resolution for both compiled JS and direct TS execution
      const possiblePaths = [
        // Environment variable takes highest priority
        process.env.KIBANA_OPENAPI_YAML_PATH,
        // Current working directory
        path.join(process.cwd(), 'kibana-openapi-source.yaml'),
        // Relative to the source file
        path.join(__dirname, 'kibana-openapi-source.yaml'),
        // One level up from source file (for ts-node execution)
        path.resolve(__dirname, '..', 'kibana-openapi-source.yaml'),
        // dist directory for compiled JS
        path.join(process.cwd(), 'dist', 'src', 'kibana-openapi-source.yaml')
      ].filter((p): p is string => typeof p === 'string' && p.length > 0);
    
      for (const p of possiblePaths) {
        if (fs.existsSync(p)) {
          YAML_FILE_PATH = p;
          console.warn(`Using YAML file from: ${p}`);
          break;
        }
      }
    
      if (!YAML_FILE_PATH) {
        console.error('Could not find kibana-openapi-source.yaml file');
        isIndexBuilt = true;
        return;
      }
    
      try {
        const yamlContent = fs.readFileSync(YAML_FILE_PATH, 'utf8');
        openApiDoc = yaml.load(yamlContent);
        
        if (!openApiDoc || !openApiDoc.paths) {
          throw new Error('Invalid YAML file structure: missing paths');
        }
    
        for (const [pathStr, pathObj] of Object.entries(openApiDoc.paths)) {
          for (const [method, methodObj] of Object.entries(pathObj as Record<string, any>)) {
            if (["get", "post", "put", "delete", "patch"].includes(method)) {
              apiEndpointIndex.push({
                path: pathStr as string,
                method: method.toUpperCase(),
                description: (methodObj as any).description,
                summary: (methodObj as any).summary,
                parameters: (methodObj as any).parameters,
                requestBody: (methodObj as any).requestBody,
                responses: (methodObj as any).responses,
                deprecated: (methodObj as any).deprecated,
                tags: (methodObj as any).tags
              });
            }
          }
        }
        isIndexBuilt = true;
      } catch (error) {
        console.error('Error loading or parsing YAML file:', error);
        throw error;
      }
    }
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 states the tool searches endpoints by keyword, but doesn't describe behavioral traits such as whether it's read-only, safe to use, what the output format looks like (e.g., list of paths, details), or any limitations (e.g., search scope, rate limits). For a 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Search Kibana API endpoints by keyword'. It's front-loaded with the core action and resource, with zero wasted words. Every part of the sentence earns its place by conveying essential purpose, making it highly concise and well-structured.

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?

Given the tool's complexity (a search function with one parameter) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a list of endpoint paths, details, or matches), how results are formatted, or any behavioral context needed for effective use. This leaves significant gaps for the agent to understand the tool's full 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?

The input schema has 100% description coverage, with the single parameter 'search' documented as 'Search keyword for filtering API endpoints'. The description adds no additional meaning beyond this, as it only repeats the keyword concept without elaborating on syntax, format, or examples. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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 Kibana API endpoints by keyword'. It specifies the verb ('search'), resource ('Kibana API endpoints'), and mechanism ('by keyword'), which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'list_all_kibana_api_paths' or 'get_kibana_api_detail', which prevents a perfect 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. It doesn't mention sibling tools like 'list_all_kibana_api_paths' (which might list all endpoints without filtering) or 'get_kibana_api_detail' (which might retrieve details for a specific endpoint), leaving the agent to infer usage context. This lack of explicit when-to-use or alternative references results in minimal guidance.

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

Related 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/TocharianOU/mcp-server-kibana'

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