Skip to main content
Glama

SearchSQL

Run time-windowed SQL queries against OpenObserve streams to retrieve matching log rows for production analysis.

Instructions

Run SQL against an OpenObserve stream and return the matching rows. The stream name is the FROM target. start and end accept an ISO timestamp, a plain date, epoch seconds/ms/µs, a relative offset like "-24h" or "-90m", or "now". They default to the last 24 hours. Bucket by time with histogram(_timestamp, '1 hour'). _timestamp is microseconds since the epoch. Call StreamList first if you do not know what exists, and StreamSchema before querying a stream whose fields you have not seen — field names differ per stream and guessing wastes a round trip. Beware that many log shippers emit SEVERAL rows per request (one per output line), so a naive count(*) overstates traffic. Check the schema for a status or level field and count only rows that carry one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoWindow end. Default now.
sqlYese.g. SELECT level, count(*) AS n FROM my_stream GROUP BY level ORDER BY n DESC
sizeNoMaximum rows to return. Default 50, maximum 1000.
startNoWindow start. Default -24h.
max_field_charsNoTruncate long string fields to this length. Default 400.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses the 24h default window, that `_timestamp` is microseconds, histogram bucketing, and the non-obvious pitfall that log shippers emit multiple rows per request so count(*) overstates traffic. It stops short of stating whether non-SELECT statements are permitted or what permissions/limits apply, which matters for a free-form SQL tool.

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?

Front-loaded with the core action, followed by timestamp formats, routing guidance, and a query pitfall — each sentence earns its place. No filler or restatement of the name.

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

Completeness4/5

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

There is no output schema, so the description should ideally hint at the returned row shape, which it only gestures at ('matching rows'). For a free-form SQL tool with 100% schema coverage on inputs, everything an agent needs to invoke it correctly is present, but return-shape detail is thin.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning the schema lacks: it enumerates the accepted formats for `start`/`end` (ISO, plain date, epoch s/ms/µs, relative offsets, 'now') and confirms the 24h default. That is genuine value beyond the terse schema descriptions.

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 ('Run SQL against an OpenObserve stream and return the matching rows') and clarifies that the stream name acts as the FROM target. It also names the two sibling tools it relates to, so an agent can place it without opening another definition.

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

Usage Guidelines5/5

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

Gives explicit routing rules: call StreamList if you don't know what exists, and StreamSchema before querying an unseen stream, with the reason (field names differ and guessing wastes a round trip). This tells the agent both when to use this tool and when to call its siblings first.

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

Deploy Server

Other Tools