Query topic messages with SQL
query_messagesRun read-only SQL queries over a single topic to filter, aggregate, downsample, and retrieve event evidence from physical-world data. Returns rows as dictionaries for analysis.
Instructions
Answer quantitative questions with read-only DuckDB SQL over one topic: filtering, aggregates, downsampling, and event evidence. Call describe_data_source and describe_topic first; use the returned schema and show the SQL to the user. Returns rows as dictionaries. Use read_loggings for textual diagnostics. Time bounds are inclusive source timestamps in seconds, not offsets from the first message.
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": {
"path": "<path>",
"sql_statement": "<sql_statement>",
"topic": "<topic>"
},
"name": "query_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| path | Yes | ||
| topic | Yes | ||
| end_seconds | No | ||
| sql_statement | Yes | ||
| start_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |