Skip to main content
Glama

Run a log chart

run_log_chart
Read-only

Aggregates the project's logs into a chart and returns a compact summary: per series min/max/avg/last and up to max_points points, a table (up to 50 rows) or a single value. HPL = <search> | <aggregations> [by <fields>] [every <interval>] [compare <1h|1d|1w|4w>] [| eval <alias> = <formula>] [| sort <alias> asc|desc] [| limit <n>] [| table|scalar]. Search: the Logs language (service:api, level:>=warn, attr.:value, value lists field:(a|b), "phrase", -word; no OR). Aggregations: count(), count_if(), count_distinct(f), sum/avg/min/max(f), p50/p75/p90/p95/p99(f), rate(), histogram(f, n); as <alias>. Fields: service, host, environment, level, source, pattern, attr., resource.. Intervals: auto, 10s … 1d. Examples: level:>=error | count() by service every 5m · attr.http.route:* | p95(attr.duration_ms) as p95, count() as n by attr.http.route | sort p95 desc | limit 10 · service:api | count_if(level:>=error) as err, count() as all | eval rate = err / all * 100 | scalar · | count() by level compare 1d. Pass hpl (text) or spec (a ChartSpec JSON object), not both. Never SQL. The engine reads the per-minute rollup or a derived metric when it can (meta.engine.planner), raw lines otherwise.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd. Default now.
hplNoThe chart as HPL, e.g. `level:>=error | count() by service every 15m compare 1d`.
fromNoStart. Default 1h ago. ISO 8601, epoch ms, or relative (15m, 1h, 24h, 7d, 90d). Raw lines answer up to 7 days; counts by service/level and derived metrics up to 400 days.
specNoThe chart as a ChartSpec v1 object ({v: 1, filter, aggregations, formulas, group_by, interval, compare, having, sort, limit, output}).
variablesNoDashboard variables the chart reads, e.g. {"service": ["api", "web"]}. An unset variable drops its term.
max_pointsNoPoints per series. Default 60 (thinned evenly, last kept).
max_seriesNoSeries to return. Default 10.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only supply readOnlyHint=true and openWorldHint=false; the description adds genuine behavioral context beyond that — the engine prefers the per-minute rollup or a derived metric and falls back to raw lines, with retention differences (raw up to 7 days vs. aggregated up to 400), plus output caps (max_points, 50-row table). It omits auth requirements and rate limits, so not a 5.

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 purpose and return shape, then dense but well-organized grammar, examples, and the engine note. It is long, but the length is largely earned given that HPL syntax is documented nowhere else; a few of the enumerated grammar lists could still be tightened.

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?

Despite no output schema, the description fully characterizes the return value (per-series min/max/avg/last plus points, a table, or a scalar) and explains the hpl/spec/variables interaction and engine selection. Nothing an agent needs to call this correctly is left unexplained.

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

Parameters5/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes well beyond it: it supplies the full HPL grammar (search language, aggregations, group-by fields, intervals, compare, eval/sort/limit/table/scalar), worked examples, and the mutually-exclusive hpl/spec rule. That is real semantic detail the schema's one-line parameter descriptions do not carry.

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?

Opens with a specific verb and resource — 'Aggregates the project's logs into a chart' — and immediately clarifies the return shape (per-series min/max/avg/last, capped points, table or scalar), which distinguishes it from a raw log search at a glance. It never names a sibling such as search_logs or summarize_log_errors, so the differentiation is inferential rather than explicit.

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

Usage Guidelines3/5

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

Gives parameter-level constraints ('Pass `hpl` or `spec`, not both. Never SQL') and implies the tool's role through its output description, but offers no when-to-use guidance relative to the many sibling log tools (e.g. when to chart vs. when to grep raw lines). Usage must be inferred from the described grammar and outputs.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.