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
feat: Add pagination support to console logs to prevent LLM token limits
- Add offset and limit parameters to GetConsoleLogsResource and GetConsoleLogsTool
- Implement GetLogsAsJson method with pagination in ConsoleLogsService
- Return logs in newest-first order for better debugging workflow
- Add automatic memory management with configurable cleanup thresholds
- Update resource descriptions with pagination usage recommendations
- Enhance Unity-side and Node.js-side implementations consistently
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Description="Retrieves logs from the Unity console, optionally filtered by type (error, warning, info)";
16
+
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
17
Uri="unity://logs/{logType}";
18
18
19
19
_consoleLogsService=consoleLogsService;
20
20
}
21
21
22
22
/// <summary>
23
-
/// Fetch logs from the Unity console, optionally filtered by type
23
+
/// Fetch logs from the Unity console, optionally filtered by type with pagination support
24
24
/// </summary>
25
-
/// <param name="parameters">Resource parameters as a JObject (may include 'logType')</param>
26
-
/// <returns>A JObject containing the list of logs</returns>
25
+
/// <param name="parameters">Resource parameters as a JObject (may include 'logType', 'offset', 'limit')</param>
26
+
/// <returns>A JObject containing the list of logs with pagination info</returns>
@@ -13,25 +13,25 @@ function listLogTypes(resourceMimeType) {
13
13
{
14
14
uri: `unity://logs/`,
15
15
name: "All logs",
16
-
description: "Retrieve all Unity console logs",
16
+
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.",
17
17
mimeType: resourceMimeType
18
18
},
19
19
{
20
20
uri: `unity://logs/error`,
21
21
name: "Error logs",
22
-
description: "Retrieve only error logs from the Unity console",
22
+
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.",
23
23
mimeType: resourceMimeType
24
24
},
25
25
{
26
26
uri: `unity://logs/warning`,
27
27
name: "Warning logs",
28
-
description: "Retrieve only warning logs from the Unity console",
28
+
description: "Retrieve only warning logs from Unity console (newest first). Use pagination ?offset=0&limit=30 to manage token usage effectively.",
29
29
mimeType: resourceMimeType
30
30
},
31
31
{
32
32
uri: `unity://logs/info`,
33
33
name: "Info logs",
34
-
description: "Retrieve only info logs from the Unity console",
34
+
description: "Retrieve only info logs from Unity console (newest first). Use smaller limits like ?limit=25 to prevent token overflow in LLM responses.",
35
35
mimeType: resourceMimeType
36
36
}
37
37
]
@@ -43,7 +43,7 @@ function listLogTypes(resourceMimeType) {
description: 'Retrieve Unity console logs by type',
46
+
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.',
0 commit comments