Skip to main content
Glama

Add Esql Metric Panel

add_esql_metric_panel

Add an ES|QL metric panel to an existing Kibana dashboard by running a query and showing a chosen output column as a single-number metric. Use it for query-based KPI panels.

Instructions

Add an ES|QL metric panel to an existing dashboard: run an ES|QL query and show one of its output columns as a single-number metric. esql is the query (e.g. 'FROM logs | STATS total = COUNT(*)') and column names the output column to display (e.g. 'total'). For field-based charts use add_panel with a VizSpec instead. The query is NOT validated server-side — a wrong query or column yields an empty panel, so write both carefully. dashboard_id comes from search_dashboards.

space targets a Kibana space by id (default: the default space).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "dashboard_id": "<dashboard_id>",
      "title": "<title>",
      "esql": "<esql>",
      "column": "<column>"
    },
    "name": "add_esql_metric_panel"
  }
}

Input Schema

NameRequiredDescriptionDefault
esqlYes
spaceNo
titleYes
columnYes
dashboard_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent write, and the description adds genuinely non-obvious behavior: the query is not validated server-side and a wrong query or column silently produces an empty panel. That failure mode is the key thing an agent must know before calling. It does not mention permission requirements or whether repeated calls with the same title create duplicates, leaving some mutation semantics unstated.

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?

Front-loaded with the core action, then follows with parameter examples, the sibling alternative, and the validation caveat in a logical order. Slightly longer than strictly necessary — the query example and the column example could be one clause — but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be documented, and everything else an agent needs to construct a correct call is present: required inputs, their formats, the silent-empty-panel failure mode, the space default, and the sibling alternative for field-based charts. Complete for a modest five-parameter panel-creation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the burden, and it largely does: it explains esql with an example query, column with an example value, dashboard_id's source, and space's default and id-targeting meaning. Only title is left implicit, which is self-evident, but the string-pattern constraint on space and the expected format of dashboard_id are not spelled out.

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?

States a specific verb and resource ('Add an ES|QL metric panel to an existing dashboard') and then defines the mechanism: run an ES|QL query and render one output column as a single-number metric. It explicitly distinguishes itself from add_panel with VizSpec, so an agent can separate this from the field-based chart path without opening schemas.

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?

Gives a clear routing rule ('For field-based charts use add_panel with a VizSpec instead') and a provenance hint for dashboard_id ('comes from search_dashboards'). It stops short of stating when to prefer this over the sibling add_esql_table_panel or add_esql_xy_panel, so the alternative set is only partially covered, but the guidance present is concrete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.