Skip to main content
Glama
TocharianOU

Kibana MCP Server

by TocharianOU

get_available_spaces

Retrieve all available Kibana spaces with detailed information using the provided context to manage and organize data efficiently.

Instructions

Get all available Kibana spaces with current context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_detailsNoInclude detailed space information (name, description, etc.)

Implementation Reference

  • Registration of the 'get_available_spaces' tool including inline schema and handler. The handler fetches available Kibana spaces using kibanaClient.get('/api/spaces/space'), formats the response with default space info and optional details, handles errors.
    server.tool(
      "get_available_spaces",
      "Get all available Kibana spaces with current context",
      z.object({
        include_details: z.boolean().optional().default(true).describe("Include detailed space information (name, description, etc.)")
      }),
      async ({ include_details = true }): Promise<ToolResponse> => {
        try {
          const response = await kibanaClient.get('/api/spaces/space');
          
          const result = {
            current_default_space: defaultSpace,
            total_count: response.length,
            available_spaces: include_details ? response : response.map((space: any) => ({
              id: space.id,
              name: space.name
            }))
          };
          
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result, null, 2)
              }
            ]
          };
        } catch (error) {
          console.error(`Failed to get available spaces: ${error}`);
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error instanceof Error ? error.message : String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • index.ts:299-299 (registration)
    Top-level call to registerBaseTools which includes the 'get_available_spaces' tool among base tools.
    registerBaseTools(serverBase, kibanaClient, defaultSpace),
  • The core handler logic for executing the 'get_available_spaces' tool: retrieves spaces from Kibana API, processes and returns as JSON with error handling.
    async ({ include_details = true }): Promise<ToolResponse> => {
      try {
        const response = await kibanaClient.get('/api/spaces/space');
        
        const result = {
          current_default_space: defaultSpace,
          total_count: response.length,
          available_spaces: include_details ? response : response.map((space: any) => ({
            id: space.id,
            name: space.name
          }))
        };
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        console.error(`Failed to get available spaces: ${error}`);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for the tool using Zod: optional boolean to include full space details.
    z.object({
      include_details: z.boolean().optional().default(true).describe("Include detailed space information (name, description, etc.)")
    }),
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on permissions needed, rate limits, pagination, or what 'current context' entails. This is a significant gap for a tool that likely interacts with a Kibana API.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'available spaces' means, what 'current context' includes, or what the return values look like. For a tool that likely returns a list of Kibana spaces, more context is needed to guide the agent effectively.

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%, so the input schema already documents the 'include_details' parameter. The description doesn't add any parameter-specific information beyond what's in the schema, such as examples or edge cases, but the baseline is 3 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'all available Kibana spaces with current context', making the purpose understandable. However, it doesn't explicitly differentiate this tool from its siblings like 'list_all_kibana_api_paths' or 'search_kibana_api_paths', which might also involve listing Kibana resources.

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 any prerequisites, exclusions, or compare it to sibling tools like 'list_all_kibana_api_paths', leaving the agent to infer usage from the tool name alone.

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