---
title: "mcpLog"
description: "The mcpLog namespace — the engine's Luau API reference for mcpLog."
section: "API Reference"
slug: "api-mcplog"
canonical: "https://origozero.ai/docs/api-mcplog"
updated: "2026-09-05T23:13:46.764905126+00:00"
tags: ["api", "reference"]
---

# mcpLog

The `mcpLog` namespace — 7 functions.

## globals/mcpLog/clear {#globals-mcplog-clear}

```lua
mcpLog.clear() -> boolean
```

Clear all entries from the engine's MCP log ring buffer.

**Returns** `boolean` — True on success.

```lua
mcpLog.clear()
```

## globals/mcpLog/query {#globals-mcplog-query}

```lua
mcpLog.query(limit: number?) -> { McpLogEntry }
```

Return the most-recent MCP tool-call entries from the engine's
MCP log ring buffer (newest last). Pass `limit` to cap how many
entries are returned — omit for the full ring (up to 500 entries).

**Parameters**

- `limit` `number` _(optional)_ — Maximum number of entries to return.

**Returns** `{ McpLogEntry }` — Array of tool-call entry tables.

```lua
for _, e in ipairs(mcpLog.query(50)) do print(e.tool_name, e.status) end
```

## modules/mcpLog/README {#modules-mcplog-readme}

```lua
require("@builtin/modules/api/engine/mcpLog") -- mcpLog (also available as global 'mcpLog')
```

Read-only MCP tool-call log ring buffer. Public Luau surface over the `__mcpLog` Internal FFI namespace.

Usage: local mcpLog = require("@builtin/modules/api/engine/mcpLog")
Also available as global: mcpLog

## modules/mcpLog/clear {#modules-mcplog-clear}

```lua
clear(): boolean
```

Clear all entries from the engine's MCP log ring buffer.

```lua
mcpLog.clear()
```

## modules/mcpLog/query {#modules-mcplog-query}

```lua
query(limit: number?): { McpLogEntry }
```

Return the most-recent MCP tool-call entries from the engine's
MCP log ring buffer (newest last). Pass `limit` to cap how many
entries are returned — omit for the full ring (up to 500 entries).

**Parameters**

- `limit` `number?` _(optional)_ — Maximum number of entries to return.

```lua
for _, e in ipairs(mcpLog.query(50)) do print(e.tool_name, e.status) end
```

## typed/builtin//modules/api/engine/mcpLog/mcpLog/clear {#typed-builtin-modules-api-engine-mcplog-mcplog-clear}

```lua
mcpLog.clear() -> boolean
```

Clear all entries from the engine's MCP log ring buffer.

**Returns** `boolean` — True on success.

```lua
mcpLog.clear()
```

## typed/builtin//modules/api/engine/mcpLog/mcpLog/query {#typed-builtin-modules-api-engine-mcplog-mcplog-query}

```lua
mcpLog.query(limit: number?) -> { McpLogEntry }
```

Return the most-recent MCP tool-call entries from the engine's
MCP log ring buffer (newest last). Pass `limit` to cap how many
entries are returned — omit for the full ring (up to 500 entries).

**Parameters**

- `limit` `number` _(optional)_ — Maximum number of entries to return.

**Returns** `{ McpLogEntry }` — Array of tool-call entry tables.

```lua
for _, e in ipairs(mcpLog.query(50)) do print(e.tool_name, e.status) end
```
