Skip to content

Commit 988af2e

Browse files
dsarnoclaude
andauthored
Remove unimplemented since_timestamp parameter from read_console (#753) (#770)
Unity internal LogEntry type does not expose timestamp data via reflection, so the parameter was accepted but silently did nothing. Remove it from Python, C#, and tool reference docs. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e736b39 commit 988af2e

4 files changed

Lines changed: 1 addition & 19 deletions

File tree

.claude/skills/unity-mcp-skill/references/tools-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ read_console(
528528
types=["error", "warning", "log"], # or ["all"]
529529
count=10, # max messages (ignored with paging)
530530
filter_text="NullReference", # optional text filter
531-
since_timestamp="2024-01-01T00:00:00Z", # optional time filter
532531
page_size=50,
533532
cursor=0,
534533
format="detailed", # "plain"|"detailed"|"json"

MCPForUnity/Editor/Tools/ReadConsole.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public static class ReadConsole
3030
private static FieldInfo _messageField;
3131
private static FieldInfo _fileField;
3232
private static FieldInfo _lineField;
33-
// Note: Timestamp is not directly available in LogEntry; need to parse message or find alternative?
34-
33+
3534
// Static constructor for reflection setup
3635
static ReadConsole()
3736
{
@@ -169,7 +168,6 @@ public static object HandleCommand(JObject @params)
169168
int? pageSize = p.GetInt("pageSize");
170169
int? cursor = p.GetInt("cursor");
171170
string filterText = p.Get("filterText");
172-
string sinceTimestampStr = p.Get("sinceTimestamp"); // TODO: Implement timestamp filtering
173171
string format = p.Get("format", "plain").ToLower();
174172
bool includeStacktrace = p.GetBool("includeStacktrace", false);
175173

@@ -178,14 +176,6 @@ public static object HandleCommand(JObject @params)
178176
types = new List<string> { "error", "warning", "log" }; // Expand 'all'
179177
}
180178

181-
if (!string.IsNullOrEmpty(sinceTimestampStr))
182-
{
183-
McpLog.Warn(
184-
"[ReadConsole] Filtering by 'since_timestamp' is not currently implemented."
185-
);
186-
// Need a way to get timestamp per log entry.
187-
}
188-
189179
return GetConsoleEntries(
190180
types,
191181
count,
@@ -326,8 +316,6 @@ bool includeStacktrace
326316
continue;
327317
}
328318

329-
// TODO: Filter by timestamp (requires timestamp data)
330-
331319
// --- Formatting ---
332320
string stackTrace = includeStacktrace ? ExtractStackTrace(message) : null;
333321
// Always get first line for the message, use full message only if no stack trace exists
@@ -358,7 +346,6 @@ bool includeStacktrace
358346
message = messageOnly,
359347
file = file,
360348
line = line,
361-
// timestamp = "", // TODO
362349
stackTrace = stackTrace, // Will be null if includeStacktrace is false or no stack found
363350
};
364351
break;

Server/src/services/tools/read_console.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ async def read_console(
3636
count: Annotated[int | str,
3737
"Max messages to return in non-paging mode (accepts int or string, e.g., 5 or '5'). Ignored when paging with page_size/cursor."] | None = None,
3838
filter_text: Annotated[str, "Text filter for messages"] | None = None,
39-
since_timestamp: Annotated[str,
40-
"Get messages after this timestamp (ISO 8601)"] | None = None,
4139
page_size: Annotated[int | str,
4240
"Page size for paginated console reads. Defaults to 50 when omitted."] | None = None,
4341
cursor: Annotated[int | str,
@@ -118,7 +116,6 @@ async def read_console(
118116
"types": types,
119117
"count": count,
120118
"filterText": filter_text,
121-
"sinceTimestamp": since_timestamp,
122119
"pageSize": coerced_page_size,
123120
"cursor": coerced_cursor,
124121
"format": format.lower() if isinstance(format, str) else format,

unity-mcp-skill/references/tools-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ read_console(
528528
types=["error", "warning", "log"], # or ["all"]
529529
count=10, # max messages (ignored with paging)
530530
filter_text="NullReference", # optional text filter
531-
since_timestamp="2024-01-01T00:00:00Z", # optional time filter
532531
page_size=50,
533532
cursor=0,
534533
format="detailed", # "plain"|"detailed"|"json"

0 commit comments

Comments
 (0)