unity-mcp/MCPForUnity/Editor/Tools
dsarno b0f7a80df0
Codex/optimize and paginate read console tool (#511)
* Optimize read_console defaults and paging

* Fix read_console truncate test expectations

* Reduce read_console default count from 50 to 10

Further optimize token usage by reducing the default count from 50 to 10 entries. Even 10-20 messages with stack traces can be token-heavy. Added tests for default behavior and paging functionality. Updated tool description to document defaults and paging support.

* Fix ReadConsoleTests to include log type messages

The default types filter changed to ['error', 'warning'] (excluding 'log'), so tests using Debug.Log() need to explicitly request log messages. Also added format='detailed' to HandleCommand_Get_Works test since it accesses structured message fields.

* Address CodeRabbit review feedback

- Fix property naming consistency: next_cursor -> nextCursor (C# camelCase)
- Remove redundant EndGettingEntries call from catch block (already in finally)
- Extract stacktrace stripping to helper function (reduce duplication)
- Fix test mock to match actual C# response structure (items, nextCursor, truncated, total)

* perf: add early exit optimization for ReadConsole paging

- Add early exit in paging loop once page is filled, avoiding iteration
  through remaining console entries (total becomes 'at least N')
- Prefix unused mock arguments with underscores in test_read_console_truncate.py
  to suppress Ruff linter warnings

* refactor: give pageSize independent default, clarify count semantics

- Change pageSize resolution from 'pageSize ?? count ?? 50' to 'pageSize ?? 50'
  so pageSize has its own default independent of count
- count now only serves as the non-paging limit
- Add XML docs to GetConsoleEntries with clear parameter descriptions
- Update Python tool annotations to document pageSize default (50) and
  clarify that count is ignored when paging
2026-01-04 14:46:52 -08:00
..
Prefabs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
BatchExecute.cs [FEATURE] Batch Commands (#418) 2025-12-07 19:36:44 -05:00
BatchExecute.cs.meta [FEATURE] Batch Commands (#418) 2025-12-07 19:36:44 -05:00
CommandRegistry.cs [FEATURE] Custom Tool Fix and Add inspection window for all the tools (#414) 2025-12-07 19:38:32 -05:00
CommandRegistry.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ExecuteMenuItem.cs [FEATURE] Custom Tool Fix and Add inspection window for all the tools (#414) 2025-12-07 19:38:32 -05:00
ExecuteMenuItem.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
GetTestJob.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
GetTestJob.cs.meta Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
JsonUtil.cs Harden MCP tool parameter handling + add material workflow tests (TDD) (#343) 2025-10-23 17:57:27 -07:00
JsonUtil.cs.meta fix: add missing JsonUtil.cs.meta file to resolve package import errors 2025-10-23 19:42:58 -07:00
ManageAsset.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
ManageAsset.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageEditor.cs Fix manage prefabs (#405) 2025-11-28 18:47:11 -04:00
ManageEditor.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageGameObject.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
ManageGameObject.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageMaterial.cs ManageGameObject/Material + auto-select sole Unity instance (#502) 2026-01-01 21:04:10 -08:00
ManageMaterial.cs.meta feat: Add `manage_material` tool for dedicated material manipulation (#440) 2025-12-07 19:39:52 -08:00
ManageScene.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
ManageScene.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScript.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
ManageScript.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ManageScriptableObject.cs feature/Add new manage_scriptable_object tool (#489) 2025-12-28 20:15:50 -08:00
ManageScriptableObject.cs.meta feature/Add new manage_scriptable_object tool (#489) 2025-12-28 20:15:50 -08:00
ManageShader.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
ManageShader.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
McpForUnityToolAttribute.cs HTTP Server, uvx, C# only custom tools (#375) 2025-11-24 23:21:06 -04:00
McpForUnityToolAttribute.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
Prefabs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
ReadConsole.cs Codex/optimize and paginate read console tool (#511) 2026-01-04 14:46:52 -08:00
ReadConsole.cs.meta Rename plugin folder to MCPForUnity (#303) 2025-10-03 20:23:28 -04:00
RefreshUnity.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
RefreshUnity.cs.meta Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
RunTests.cs Feature/run tests summary clean (#501) 2026-01-01 20:36:45 -08:00
RunTests.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
RunTestsAsync.cs Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00
RunTestsAsync.cs.meta Async Test Infrastructure & Editor Readiness Status + new refresh_unity tool (#507) 2026-01-03 12:42:32 -08:00