Skip to main content
Glama

list_all_kibana_api_paths

Retrieve a comprehensive list of all Kibana API endpoints for easy reference and integration with the Kibana MCP Server.

Instructions

List all Kibana API endpoints as a resource list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for 'list_all_kibana_api_paths' tool. Builds the API endpoint index if not already done and returns all Kibana API paths as a structured JSON resource.
    async (): Promise<ToolResponse> => { await buildApiIndex(); const endpoints = apiEndpointIndex.map(e => ({ method: e.method, path: e.path, summary: e.summary, description: e.description })); return { content: [ { type: "text", text: JSON.stringify({ contents: [ { uri: "kibana-api://paths", mimeType: "application/json", text: JSON.stringify(endpoints, null, 2) } ] }, null, 2) } ] }; }
  • Registration of the 'list_all_kibana_api_paths' tool using server.tool(), including schema (empty input) and inline handler.
    server.tool( "list_all_kibana_api_paths", `List all Kibana API endpoints as a resource list`, z.object({}), async (): Promise<ToolResponse> => { await buildApiIndex(); const endpoints = apiEndpointIndex.map(e => ({ method: e.method, path: e.path, summary: e.summary, description: e.description })); return { content: [ { type: "text", text: JSON.stringify({ contents: [ { uri: "kibana-api://paths", mimeType: "application/json", text: JSON.stringify(endpoints, null, 2) } ] }, null, 2) } ] }; } );
  • Zod schema for the tool input (empty object, no parameters required).
    z.object({}),
  • Supporting helper function to build the index of all Kibana API endpoints from the OpenAPI YAML file, called by the handler.
    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; } }
  • index.ts:299-299 (registration)
    Invocation of registerBaseTools which registers the list_all_kibana_api_paths tool among other base tools.
    registerBaseTools(serverBase, kibanaClient, defaultSpace),

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