You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
### Tools
6
6
7
7
-`find_entities_by_name` now uses `smartscapeNode` DQL command under the hood, and will fall back to `fetch dt.entity.${entityType}`.
8
+
- Added default response limiting to `execute_dql` tool with new parameters `recordLimit` (default 100) and `recordSizeLimitMB` (default 1 MB) to prevent overwhelming LLM context. These limits apply only to the returned payload, not the underlying DQL execution.
console.error('No OAuth credentials or platform token provided - switching to OAuth authorization code flow.');
130
129
oauthClientId=DT_MCP_AUTH_CODE_FLOW_OAUTH_CLIENT_ID;// Default OAuth client ID for auth code flow
@@ -606,6 +605,12 @@ const main = async () => {
606
605
'DQL Statement (Ex: "fetch [logs, spans, events, metric.series, ...], from: now()-4h, to: now() [| filter <some-filter>] [| summarize count(), by:{some-fields}]", or for metrics: "timeseries { avg(<metric-name>), value.A = avg(<metric-name>, scalar: true) }", or for entities via smartscape: "smartscapeNodes \"[*, HOST, PROCESS, ...]\" [| filter id == "<ENTITY-ID>"]"). '+
607
606
'When querying data for a specific entity, call the `find_entity_by_name` tool first to get an appropriate filter like `dt.entity.service == "SERVICE-1234"` or `dt.entity.host == "HOST-1234"` to be used in the DQL statement. ',
608
607
),
608
+
recordLimit: z.number().optional().default(100).describe('Maximum number of records to return (default: 100)'),
609
+
recordSizeLimitMB: z
610
+
.number()
611
+
.optional()
612
+
.default(1)
613
+
.describe('Maximum size of the returned records in MB (default: 1MB)'),
609
614
},
610
615
{
611
616
// not readonly (DQL statements may modify things), not idempotent (may change over time)
@@ -614,7 +619,7 @@ const main = async () => {
614
619
// while we are not strictly talking to the open world here, the response from execute DQL could interpreted as a web-search, which often is referred to open-world
return'DQL execution failed or returned no result.';
@@ -677,6 +686,10 @@ const main = async () => {
677
686
result+=`- **⚠️ Sampling Used:** Yes (results may be approximate)\n`;
678
687
}
679
688
689
+
if(response.records.length===recordLimit){
690
+
result+=`- **⚠️ Record Limit Reached:** The result set was limited to ${recordLimit} records. Consider changing your query with a smaller timeframe, an aggregation or a more concise filter. Alternatively, increase the recordLimit if you expect more results.\n`;
0 commit comments