@anyshift/mcp-proxy 0.4.1 → 0.4.2-dev0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,18 @@ import { generateQueryAssistSchema, generateJsonlQueryAssistSchema } from './sch
5
5
  import { parseDynatraceDqlResponse, isDynatraceDqlTool, } from './dynatrace.js';
6
6
  // Default minimum character count to trigger file writing
7
7
  const DEFAULT_MIN_CHARS = 1000;
8
+ /**
9
+ * Generate the message to include when data is written to file, guiding the LLM on how to use the result.
10
+ * The message conditionally includes the timeseries tool based on configuration.
11
+ */
12
+ function getFileWrittenMessage(enableTimeseries) {
13
+ const toolsList = enableTimeseries
14
+ ? '"execute_jq_query" tool (for JSON/JSONL data extraction and transformation) or "detect_timeseries_anomalies" tool (for time series analysis)'
15
+ : '"execute_jq_query" tool (for JSON/JSONL data extraction and transformation)';
16
+ return `To read this file, use the ${toolsList}.
17
+
18
+ IMPORTANT for supporting facts: This tool_id CANNOT be used as the proxy_tool_id in your output's supporting_facts evidence. You must read the file using one of the tools above and use THAT tool's tool_id as the proxy_tool_id to support facts in your output.`;
19
+ }
8
20
  /**
9
21
  * Detect whether content is JSON, JSONL, or plain text
10
22
  */
@@ -251,6 +263,7 @@ async function handleDynatraceDqlResponse(config, tool_id, parsedDql) {
251
263
  wroteToFile: true,
252
264
  filePath: filepath,
253
265
  fileSchema,
266
+ message: getFileWrittenMessage(config.enableTimeseries ?? false),
254
267
  };
255
268
  }
256
269
  catch (error) {
@@ -388,6 +401,7 @@ export async function handleToolResponse(config, toolName, args, responseData) {
388
401
  wroteToFile: true,
389
402
  filePath: filepath,
390
403
  fileSchema,
404
+ message: getFileWrittenMessage(config.enableTimeseries ?? false),
391
405
  };
392
406
  }
393
407
  catch (error) {
package/dist/index.js CHANGED
@@ -324,7 +324,8 @@ async function main() {
324
324
  toolAbbreviations: {}, // No service-specific abbreviations (generic proxy)
325
325
  schemaMaxDepth: SCHEMA_MAX_DEPTH,
326
326
  schemaMaxPaths: SCHEMA_MAX_PATHS,
327
- schemaMaxKeys: SCHEMA_MAX_KEYS
327
+ schemaMaxKeys: SCHEMA_MAX_KEYS,
328
+ enableTimeseries: ENABLE_TIMESERIES
328
329
  };
329
330
  const fileWriter = createFileWriter(fileWriterConfig);
330
331
  // JQ tool configuration
@@ -34,6 +34,8 @@ export interface FileWriterConfig {
34
34
  schemaMaxPaths?: number;
35
35
  /** Maximum keys to analyze per object (default: 50) */
36
36
  schemaMaxKeys?: number;
37
+ /** Whether the timeseries anomaly detection tool is enabled (affects file-written message) */
38
+ enableTimeseries?: boolean;
37
39
  }
38
40
  /**
39
41
  * Configuration for the JQ tool
@@ -74,4 +76,6 @@ export interface UnifiedToolResponse {
74
76
  isRetryAttempt?: boolean;
75
77
  /** The original tool_id this call is retrying */
76
78
  originalToolId?: string;
79
+ /** Informational message for the LLM (e.g., guidance on how to use the file) */
80
+ message?: string;
77
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anyshift/mcp-proxy",
3
- "version": "0.4.1",
3
+ "version": "0.4.2-dev0",
4
4
  "description": "Generic MCP proxy that adds truncation, file writing, and JQ capabilities to any MCP server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",