Roka Roka Docs

MCP

Tools

After a successful serve, the agent sees three tools. All of them run the same local prune pipeline. Default character budget is 4000.

prune_logs

Prune raw log text already in the conversation or tool arguments.

ArgumentTypeDescription
textstring, requiredRaw log text to prune
budgetpositive int, optionalTarget character budget (default 4000)

prune_file

Read a log file by path and prune it. Path may be absolute or relative to the server’s working directory.

ArgumentTypeDescription
pathstring, requiredPath to the log file
budgetpositive int, optionalTarget character budget (default 4000)

prune_tail

Read a live log, keep the last N lines, then prune that slice. Useful when the file is still growing.

ArgumentTypeDescription
pathstring, requiredPath to the log file
linespositive int, optionalTrailing lines to read (default 200)
budgetpositive int, optionalTarget character budget (default 4000)

Return value

On success the tool returns JSON text with:

On failure it returns an error string such as prune_file failed for "…": ….

Crash / force-keep regex

Lines matching this pattern are kept first when the collapsed text still exceeds the budget:

\b(ERROR|FATAL|CRITICAL|Exception|Traceback|panic)\b

Case-insensitive. Adjacent duplicate lines are collapsed to line (xN repeated) before ranking.