Technical Reference
This document describes the built-in tools, automation features, templates, and file/document access functions used internally by the LLM Chat package.
list_tables()
Syntax: list_tables()
Query the available table list in Machbase Neo. It returns the names of all tables owned by the current user, one per line.
Example: List Tables
Ask the chat: “Show me the table list”
The tool executes internally (the owner is resolved to the connected user):
SELECT st.NAME FROM m$sys_tables AS st
JOIN m$sys_users AS su ON st.USER_ID = su.USER_ID
WHERE su.NAME = 'SYS' AND st.FLAG = 0
ORDER BY st.NAMEEXAMPLE
GOLD
SENSORlist_table_tags()
Syntax: list_table_tags( table_name )
Get tag metadata from a tag table. It queries the _tablename_meta table and returns all tag or sensor names.
table_namestring required, tag table name
Example: List Tags
list_table_tags(table_name="EXAMPLE")[EXAMPLE] temperature, humidity, pressuredescribe_table()
Syntax: describe_table( table_name [, profile] )
Get the table type (TAG / LOG) and column structure (name, type, role such as PRIMARY KEY / BASETIME / SUMMARIZED), plus whether ROLLUP tables exist. The agentic loop calls this before generating TQL/SQL so it knows the real column names. Includes an ownership check.
table_namestring required, table name to describeprofileboolean for TAG tables, also return the tag list, per-tag statistics (count / avg / min / max), and the data time range in milliseconds. Useful when building dashboards. Default:false
Example: Describe a Table
describe_table(table_name="EXAMPLE", profile=true)[EXAMPLE] type: TAG
- NAME (varchar) PRIMARY KEY
- TIME (datetime) BASETIME
- VALUE (double) SUMMARIZED
ROLLUP: available (3 rollup tables)
...execute_sql_query()
Syntax: execute_sql_query( sql_query [, format, timeformat, timezone, limit] )
Execute an SQL query directly on Machbase Neo.
sql_querystring required, SQL query to executeformatstring output format:csv(default) orjsontimeformatstring time format:default,ms,us,nstimezonestring timezone (for exampleUTC,Asia/Seoul)limitinteger maximum rows to return. Default:500
Note:
UPDATE,DELETE, andDROPstatements are blocked for safety. When SQL execution fails, the tool returns a parsed error message.
Example: Tag Statistics
execute_sql_query(sql_query="SELECT NAME, COUNT(*), AVG(VALUE) FROM EXAMPLE GROUP BY NAME")NAME,COUNT(*),AVG(VALUE)
temperature,15230,23.456
humidity,15230,65.123
pressure,15230,1013.25Example: Time Range Query
execute_sql_query(
sql_query="SELECT MIN(TIME), MAX(TIME) FROM EXAMPLE",
timeformat="ms"
)MIN(TIME),MAX(TIME)
1695222000000,1702425600000execute_tql_script()
Syntax: execute_tql_script( tql_content )
Execute a TQL (Transforming Query Language) script on Machbase Neo. It returns chart HTML or CSV data depending on the SINK function used in the script. Output longer than 5000 characters is truncated.
tql_contentstring required, TQL script content
Example: Execute TQL with CSV Output
execute_tql_script(tql_content="SQL(`SELECT NAME, COUNT(*) FROM EXAMPLE GROUP BY NAME`)\nCSV()")temperature,15230
humidity,15230
pressure,15230Example: Execute TQL with Chart Output
SQL(`SELECT TIME, VALUE FROM EXAMPLE WHERE NAME = 'temperature' GROUP BY TIME, VALUE ORDER BY TIME`)
CHART(
size("600px", "340px"),
chartOption({
xAxis: { type: "time" },
yAxis: {},
series: [{
type: "line",
data: column(0).map(function(t, idx){ return [t, column(1)[idx]]; })
}]
}),
tz("Asia/Seoul")
)The tool returns the rendered chart as an HTML fragment.
save_tql_file()
Syntax: save_tql_file( filename, tql_content )
Save a TQL or SQL script file to Machbase Neo. TQL files are validated by execution before saving.
filenamestring required, file path (for exampleGOLD/chart.tql)tql_contentstring required, TQL script content
Before saving, the tool:
- Executes the TQL script to validate correctness (it is not saved if validation fails).
- If the query returns 0 rows, snaps the time range to the table’s actual MIN/MAX(TIME) boundaries and retries.
- Creates parent folders automatically when needed.
Example: Save a Chart TQL
save_tql_file(
filename="GOLD/avg_trend.tql",
tql_content="SQL(`SELECT ...`)\nCHART(...)"
)File saved successfully: GOLD/avg_trend.tqlIf validation fails:
TQL validation failed (not saved): MACH-ERR 2044 ...compile_tql_from_spec()
Syntax: compile_tql_from_spec( spec [, filename] )
Compile execution-verified TQL from an analysis intent (IR JSON) instead of hand-writing raw TQL. The tool auto-injects the real column names and ROLLUP availability from the database, validates tag names, corrects the time range to the actual data boundaries, and returns TQL that is guaranteed to run. This is the preferred way to generate chart TQL.
specobject required, analysis intent. Key fields:kind—metrics(single tag, one or more aggregates),tags(multi-tag comparison),ohlc(candlestick / price), orgeomap(coordinates / map)table,tag/tags,timeRange: { start, end }rollup— bucket unit (sec,min,hour,day,week,month) ornullfor rawmetrics— forkind=metrics, e.g.[{ "agg": "avg", "label": "..." }](agg: avg / max / min / sum / count / sumsq / raw)outputoptional —{ chartType: "line" | "bar", title, subtitle }
filenamestring optional, save path"TABLE/name.tql"(English only). If provided, the TQL is saved for dashboard use (reference it fromchartsviatql_path). If omitted, the verified TQL text is returned in the answer.
Example: Compile and Save a Chart
compile_tql_from_spec(
spec={"kind":"metrics","table":"GOLD","tag":"close","rollup":"day",
"metrics":[{"agg":"avg","label":"Average"}]},
filename="GOLD/avg_trend.tql"
)forecast_table()
Syntax: forecast_table( spec [, filename] )
Forecast future values for a table’s tag. The tool fits several candidate models (SES / linear / quadratic / Holt / Theta / AR / Holt-Winters additive & multiplicative / harmonic / Prophet-style), ranks them with a holdout backtest, and auto-selects the best one. It anchors the forecast to the last observed value and adds a confidence band. Calling it generates and saves an HTML report — with a tag dropdown × model dropdown to browse every tag’s and model’s forecast curve (confidence interval and backtest included) — and returns the link. One tag forecasts that tag; 2–5 tags forecast all of them; more than 5 tags auto-selects the top 5 by data count (with a note, without prompting).
specobject required, forecast intent. Key fields:tablerequiredtag— single tag to forecast (omit and the tool decides automatically), ortags: ["a","b"]for multi-tag comparison (up to 5)rollup— bucket unit (sec…month), auto-selected from the range if omittedtimeRange: { start, end }— training window (whole dataset if omitted)horizon— number of future buckets to forecast (defaults to 20% of the training length)method— model to use (defaults toauto= the leaderboard winner). Values:auto,ses,linear,quadratic,holt,theta,ar,holtwinters,holtwinters_mult,harmonic,prophet. Korean aliases (선형/2차/계절성) and rank strings (2위/rank2) are also acceptedrank— select a model by leaderboard rank (1-based, e.g.2)lookback— trend window in buckets (auto if omitted)outputoptional —{ title, subtitle }
filenamestring optional, save path"TABLE/name.tql"(English only). If provided, the report additionally saves a live-recomputing.tql(for a dashboardtql_path). If omitted, only the HTML report is generated.
Example: Forecast and Save
forecast_table(
spec={"table":"GOLD","tag":"close","rollup":"day","horizon":30},
filename="GOLD/close_forecast.tql"
)create_dashboard_with_charts()
Syntax: create_dashboard_with_charts( filename, title, charts [, time_start, time_end, refresh] )
Create a dashboard with multiple chart panels in a single call.
filenamestring required, dashboard path (for exampleGOLD/Gold_Analysis.dsh)titlestring required, dashboard titlechartsstring required, JSON array of chart definitionstime_startstring time range start (epoch ms as string). Auto-fitted to the data when omittedtime_endstring time range end (epoch ms as string). Auto-fitted to the data when omittedrefreshstring auto-refresh interval (Off,3 seconds,10 seconds,1 minute,1 hour, …). Default:Off
Each chart object in the charts array. The preferred form references a TQL file compiled with compile_tql_from_spec / forecast_table:
{ "title": "Average Trend", "tql_path": "GOLD/avg_trend.tql" }For a simple ad-hoc chart without a compiled .tql, use an inline definition. The column, name, and time columns are auto-detected from the table metadata, so omit them unless you need to override:
{ "title": "Temperature", "type": "Line", "table": "EXAMPLE", "tag": "temperature" }Supported chart types: Line, Bar, Scatter, Pie, Gauge, Text, Geomap, Video, Tql chart
Note: Candlestick / OHLC and any compiled chart must use
tql_path. An inline OHLC panel will not render. Inline (basic-analysis) charts are restricted toLine/Bar/Scatterwith real tags.
Example: Create Dashboard with TQL Charts
create_dashboard_with_charts(
filename="GOLD/Gold_Analysis.dsh",
title="GOLD Deep Analysis",
time_start="1695222000000",
time_end="1702425600000",
charts='[
{"title":"Average Trend","type":"Tql chart","tql_path":"GOLD/avg_trend.tql"},
{"title":"Volatility","type":"Tql chart","tql_path":"GOLD/volatility.tql"},
{"title":"Price Band","type":"Tql chart","tql_path":"GOLD/price_band.tql"}
]'
)Dashboard created: GOLD/Gold_Analysis.dsh (3 charts)add_chart_to_dashboard()
Syntax: add_chart_to_dashboard( filename, chart_title, chart_type [, table, tag, column, tql_path] )
Add a chart panel to an existing dashboard. The tool lays out the panel size, position, and color automatically.
filenamestring required, dashboard filenamechart_titlestring required, chart titlechart_typestring required, chart type (for exampleLine,Bar,Scatter,Tql chart)tablestring tag table nametagstring tag name(s), comma-separatedcolumnstring column name. Default:VALUEtql_pathstring TQL file path forTql chart
Example: Add a Line Chart
add_chart_to_dashboard(
filename="GOLD/Gold_Analysis.dsh",
chart_title="Temperature Trend",
chart_type="Line",
table="EXAMPLE",
tag="temperature"
)Example: Add a TQL Chart
add_chart_to_dashboard(
filename="GOLD/Gold_Analysis.dsh",
chart_title="FFT Spectrum",
chart_type="Tql chart",
tql_path="GOLD/fft_spectrum.tql"
)remove_chart_from_dashboard()
Syntax: remove_chart_from_dashboard( filename [, panel_id, panel_title] )
Remove a chart panel from a dashboard by panel UUID or title.
filenamestring required, dashboard filenamepanel_idstring panel UUID to removepanel_titlestring panel title to remove
update_chart_in_dashboard()
Syntax: update_chart_in_dashboard( filename [, panel_id, panel_title, new_title] )
Update the title of an existing chart panel in a dashboard. Target the panel by UUID or title.
filenamestring required, dashboard filenamepanel_idstring panel UUIDpanel_titlestring panel title (first match)new_titlestring new panel title
get_dashboard()
Syntax: get_dashboard( filename )
Get the full configuration of a dashboard as JSON.
filenamestring required, dashboard filename
delete_dashboard()
Syntax: delete_dashboard( filename )
Delete a dashboard file from Machbase Neo.
filenamestring required, dashboard filename to delete
update_dashboard_time_range()
Syntax: update_dashboard_time_range( filename [, time_start, time_end, refresh] )
Update the time range of a dashboard.
filenamestring required, dashboard filenametime_startstring start time (set to empty when omitted)time_endstring end time (set to empty when omitted)refreshstring auto-refresh interval. Default:Off
preview_dashboard()
Syntax: preview_dashboard( filename )
Get a dashboard preview and a direct Neo Web UI link.
filenamestring required, dashboard filename
save_html_report()
Syntax: save_html_report( table [, template_id, tag_name, analysis, recommendations, rollup_unit, time_start, time_end, tag_count, data_count, time_range] )
Generate an HTML analysis report with charts and deep analysis. The tool internally performs data retrieval, FFT/statistical calculations, chart generation, and HTML file creation.
tablestring required, table name (for exampleGOLD)template_idstring report template ID. If omitted, a built-in template is auto-detected from the datatag_namestring target tag or symbol name. Pass it whenever the user mentions a specific target — omitting it scans the whole table (thousands of tags) and can be slow or exceed contextanalysisstring deep analysis text (markdown). Leave empty on the first call; fill it on the second callrecommendationsstring overall findings and recommendations (markdown). Leave empty on the first callrollup_unitstring one ofsec,min,hour,day,week,monthtime_startstring analysis start (epoch ms). Pass only when the user gives an explicit periodtime_endstring analysis end (epoch ms), paired withtime_starttag_count/data_count/time_rangestring optional descriptive metadata
Report Templates
Built-in templates live under neo/report/; custom C-* templates can be dropped into neo/report/custom/.
| Template ID | Type | Description |
|---|---|---|
R-0-general | General | Basic statistical analysis with trend charts |
R-1-finance | Financial | Price bands, volatility, and log-scale analysis |
R-2-vibration | Vibration | RMS, FFT spectrum, envelope, and crest factor |
R-3-driving | Driving | Speed/RPM correlation and driving pattern analysis |
C-1-energy | Custom (example) | Energy-analysis custom report template |
Example: Generate a Financial Report
First call — the tool queries the data and returns a chart analysis summary (leave analysis empty):
save_html_report(table="GOLD", template_id="R-1-finance", tag_name="close")Chart analysis summary: Gold price from 2023-09-20 to 2025-12-13 ...
Please call again with this summary in the analysis parameter.Second call — the tool generates the final HTML report:
save_html_report(
table="GOLD",
template_id="R-1-finance",
tag_name="close",
analysis="Gold price from 2023-09-20 to 2025-12-13 ...",
recommendations="1. ..."
)Report saved: GOLD/GOLD_financial_report.htmllist_timers()
Syntax: list_timers()
List all timers or schedulers registered in Machbase Neo. It returns the name, state (RUNNING / STOP), schedule, and TQL path for each timer.
Example: List Timers
list_timers()[
{
"name": "SENSOR_DATA",
"state": "RUNNING",
"schedule": "@every 10s",
"path": "SENSOR_DATA/SENSOR_DATA.tql"
}
]add_timer()
Syntax: add_timer( name, schedule, path [, auto_start] )
Create a new timer or scheduler that runs a TQL script on a schedule.
namestring required, timer name (unique identifier)schedulestring required, execution schedulepathstring required, path of the TQL script to runauto_startboolean automatically start after server restart. Default:false
Schedule format examples:
| Expression | Description |
|---|---|
@every 10s | Every 10 seconds |
@every 1h30m | Every 1 hour 30 minutes |
@daily | Once a day at midnight |
0 30 * * * * | Every hour at 30 minutes |
Note: Creating a timer does not start it automatically. You must call
start_timerseparately.
Example: Create and Start a Timer
Recommended workflow:
- Create the target TAG table
CREATE TAG TABLE IF NOT EXISTS SENSOR_DATA (
name VARCHAR(80) PRIMARY KEY,
time DATETIME BASETIME,
value DOUBLE SUMMARIZED
) WITH ROLLUP;- Create the TQL script with
save_tql_file - Register the timer
add_timer(name="SENSOR_DATA", schedule="@every 10s", path="SENSOR_DATA/SENSOR_DATA.tql")Timer 'SENSOR_DATA' created successfully. (schedule: @every 10s, path: SENSOR_DATA/SENSOR_DATA.tql)
NOTE: The timer is NOT running yet. Call start_timer with name='SENSOR_DATA' to begin execution.- Start the timer
start_timer(name="SENSOR_DATA")Timer 'SENSOR_DATA' started.start_timer()
Syntax: start_timer( name )
Start an existing timer. If the timer is already running, it returns a corresponding message.
namestring required, timer name to start
stop_timer()
Syntax: stop_timer( name )
Stop a running timer.
namestring required, timer name to stop
delete_timer()
Syntax: delete_timer( name )
Delete a timer from Machbase Neo. If the timer is still running, it is automatically stopped before deletion.
namestring required, timer name to delete
To completely clean up a timer and its related resources:
stop_timer(name="SENSOR_DATA")
delete_timer(name="SENSOR_DATA")
delete_file(filename="SENSOR_DATA/SENSOR_DATA.tql")
delete_file(filename="SENSOR_DATA/")
execute_sql_query(sql_query="DROP TABLE SENSOR_DATA CASCADE")create_folder()
Syntax: create_folder( folder_name )
Create a folder in the Machbase Neo file system.
folder_namestring required, folder path to create
list_files()
Syntax: list_files( [path] )
List files and folders in the Machbase Neo file system.
pathstring directory path. Default:/
Example: List Files
list_files(path="GOLD")Files in GOLD:
[file] avg_trend.tql
[file] volatility.tql
[file] Gold_Analysis.dshdelete_file()
Syntax: delete_file( filename )
Delete a file or empty folder from the Machbase Neo file system.
filenamestring required, file path to delete
list_available_documents()
Syntax: list_available_documents()
List all available manual documentation files in Machbase Neo. It returns the documentation catalog (paths, titles, keywords).
search_documents()
Syntax: search_documents( keyword )
Search the documentation catalog by keyword and return matching document paths. Use this before get_full_document_content to find the right document. If nothing matches, it returns a no-match message with the nearest candidate documents.
keywordstring required, search keyword (for examplePIVOT,ROLLUP,TQL,chart)
Example: Search Documents
search_documents(keyword="ROLLUP")Found 2 document(s):
- sql/sql-rollup.md (ROLLUP) [rollup, aggregate]
- tql/tql-sink.md (TQL Sink) [chart, rollup]get_full_document_content()
Syntax: get_full_document_content( file_identifier [, section] )
Get manual document content. If the document is large, passing a section keyword returns only that section at full length, so deep sections (for example ADD COLUMN inside a large DDL doc) are not cut off. Without section, a large document returns its section list so you can choose one.
file_identifierstring required, document path from the catalog (copy it verbatim)sectionstring a section-header keyword to return only that section in full (for exampleADD COLUMN,RETENTION,TO_CHAR)
Example: Read a Specific Section
get_full_document_content(file_identifier="sql/sql-rollup.md", section="ADD COLUMN")Returns only the matching section of the manual document at full length.
get_document_sections()
Syntax: get_document_sections( file_identifier [, section_filter] )
Get manual document content organized by section, optionally filtered by keyword.
file_identifierstring required, file pathsection_filterstring filter sections containing this text
Example: Read Specific Sections
get_document_sections(file_identifier="tql/tql-sink.md", section_filter="CHART")Returns only the sections that contain “CHART” in the title or content.
extract_code_blocks()
Syntax: extract_code_blocks( file_identifier [, language] )
Extract all code blocks from a manual document, optionally filtered by language.
file_identifierstring required, file pathlanguagestring language filter, such asjsorsql
Example: Extract SQL Examples
extract_code_blocks(file_identifier="sql/sql-guide.md", language="sql")--- Code Block 1 [sql] ---
CREATE TAG TABLE IF NOT EXISTS example (
name varchar(100) primary key,
time datetime basetime,
value double summarized
);
--- Code Block 2 [sql] ---
INSERT INTO example VALUES('my-car', now, 1.2345);get_version()
Syntax: get_version()
Get version information for the package and the Machbase Neo server.
debug_mcp_status()
Syntax: debug_mcp_status()
Check current status and connectivity by querying Machbase Neo system tables.
Example: Health Check
debug_mcp_status(){
"tools_count": 32,
"tools": ["list_tables", "list_table_tags", "describe_table", "..."],
"runtime": "JSH",
"machbase": "connected"
}