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
Description="Retrieves logs from the Unity console (newest first), optionally filtered by type (error, warning, info). Use pagination parameters (offset, limit) to avoid LLM token limits. Recommended: limit=20-50 for optimal performance.";
17
+
Description="Retrieves logs from the Unity console (newest first), optionally filtered by type (error, warning, info). Use pagination parameters (offset, limit) to avoid LLM token limits. Set includeStackTrace=false to exclude stack traces and reduce token usage. Recommended: limit=20-50 for optimal performance.";
18
18
Uri="unity://logs/{logType}";
19
19
20
20
_consoleLogsService=consoleLogsService;
@@ -32,17 +32,20 @@ public override JObject Fetch(JObject parameters)
description: "Retrieve Unity console logs (newest first). Use pagination to avoid token limits: ?offset=0&limit=50 for recent logs. Default limit=100 may be too large for LLM context.",
16
+
description: "All Unity console logs (newest first). ⚠️ Set includeStackTrace=false to save 80-90% tokens. Use limit=50 to avoid token limits.",
description: "Retrieve only error logs from Unity console (newest first). Use ?offset=0&limit=20 to avoid token limits. Large log sets may exceed LLM context window.",
22
+
description: "Error logs only. ⚠️ Start with includeStackTrace=false for quick overview, then true only if debugging specific errors.",
description: "Retrieve only info logs from Unity console (newest first). Use smaller limits like ?limit=25 to prevent token overflow in LLM responses.",
34
+
description: "Info logs only. Stack traces excluded by default to minimize tokens.",
35
35
mimeType: resourceMimeType
36
36
}
37
37
]
@@ -43,7 +43,7 @@ function listLogTypes(resourceMimeType) {
description: 'Retrieve Unity console logs by type (newest first). IMPORTANT: Use pagination parameters ?offset=0&limit=50 to avoid LLM token limits. Default limit=100 may exceed context window.',
46
+
description: 'Retrieve Unity console logs by type with pagination support. See individual log type descriptions for optimal settings.',
.describe("Maximum number of logs to return (defaults to 50, max 500 to avoid token limits)")
23
+
.describe("Maximum number of logs to return (defaults to 50, max 500 to avoid token limits)"),
24
+
includeStackTrace: z
25
+
.boolean()
26
+
.optional()
27
+
.describe("Whether to include stack trace in logs. ⚠️ ALWAYS SET TO FALSE to save 80-90% tokens, unless you specifically need stack traces for debugging. Default: true (except info logs in resource)")
24
28
});
25
29
/**
26
30
* Creates and registers the Get Console Logs tool with the MCP server
@@ -55,7 +59,7 @@ export function registerGetConsoleLogsTool(server, mcpUnity, logger) {
55
59
* @throws McpUnityError if the request to Unity fails
description: "Retrieve only info logs from Unity console (newest first). Default pagination offset=0&limit=25.",
40
+
description: "Info logs only. Stack traces excluded by default to minimize tokens.",
41
41
mimeType: resourceMimeType
42
42
}
43
43
]
@@ -54,7 +54,7 @@ export function registerGetConsoleLogsResource(server: McpServer, mcpUnity: McpU
54
54
resourceName,
55
55
resourceTemplate,
56
56
{
57
-
description: 'Retrieve Unity console logs by type (newest first). IMPORTANT: Use pagination parameters ?offset=0&limit=50 to avoid LLM token limits. Default limit=100 may exceed context window.',
57
+
description: 'Retrieve Unity console logs by type with pagination support. See individual log type descriptions for optimal settings.',
.describe("Maximum number of logs to return (defaults to 50, max 500 to avoid token limits)")
30
+
.describe("Maximum number of logs to return (defaults to 50, max 500 to avoid token limits)"),
31
+
includeStackTrace: z
32
+
.boolean()
33
+
.optional()
34
+
.describe("Whether to include stack trace in logs. ⚠️ ALWAYS SET TO FALSE to save 80-90% tokens, unless you specifically need stack traces for debugging. Default: true (except info logs in resource)")
0 commit comments