Log inGet started

mcp

Updated 22 August 2026

The mcp namespace — 3 functions.

mcp/call

mcp.call(toolName, args?)

Call an MCP tool asynchronously. Returns a request ID to poll for the result. Use with task.await or manual polling via mcp.poll().

Parameters

  • toolName string — Name of the MCP tool to call
  • args table | string (optional) — Arguments for the tool. Table is converted to JSON, string is passed as-is

Returns string — Request ID for polling with mcp.poll()

mcp/listTools

mcp.listTools()

List all available MCP tool names.

Returns {string} — Array of tool name strings

mcp/poll

mcp.poll(requestId)

Poll for a completed MCP tool call result. Returns nil if not yet complete.

Parameters

  • requestId string — Request ID from mcp.call()

Returns { id: string, is_error: boolean, content: string } | nil — Result table with tool output, or nil if still pending

  • api
  • reference