Lookio Docs
Lookio websiteOpen Lookio
MCPCode Mode

Code Mode

Let an agent write a short script against the Lookio API in a sandbox, with two tools, search and execute, the same scopes and strict limits.

Code Mode is a second MCP server for agents that work better by writing code than by chaining many tool calls.

https://mcp.lookio.app/mcp/code

It has two tools. The standard server at /mcp is unchanged and stays the default.

ToolWhat it does
searchFinds API operations. The agent sends a JavaScript filter, which runs against Lookio’s API description inside the sandbox. Without a filter it returns every operation in a compact form, a few hundred tokens for the whole API.
executeRuns a JavaScript program with a request() function that calls the API.

The API description stays in the sandbox, so it never fills the agent’s context, and the two tool descriptions have a fixed size whatever the API grows into.

Calling the API

Inside execute, request({ method, path, query, body }) calls an endpoint and returns the parsed response: { data, request_id } and, for a list, has_more and next_cursor. A failed call throws an Error carrying the API’s message.

Re-index every failed resource
const failed = [];
let cursor;

do {
  const page = await request({
    method: "GET",
    path: "/v1/resources",
    query: { limit: 100, ...(cursor ? { cursor } : {}) },
  });
  for (const resource of page.data) {
    if (resource.status === "failed") {
      await request({ method: "POST", path: `/v1/resources/${resource.id}/reindex` });
      failed.push({ id: resource.id, title: resource.title });
    }
  }
  cursor = page.next_cursor;
} while (cursor);

return { reindexed: failed.length, failed };

Only what the script returns, and what it logs with console.log, goes back to the agent. The script should filter and summarise inside the sandbox rather than return raw rows.

Limits

LimitValue
Time for one execution30 seconds
Size of a program64 KB
Size of the result256 KB. A longer result is cut and marked [truncated by Lookio].
Log output200 lines and 32 KB
request() calls per execution100. Going over fails the whole run.

Every request() counts against the credential’s rate limit, exactly like the matching HTTP call.

Same permissions, same costs

Code Mode goes through the same routes, validation and scope checks as an HTTP request. A path the connection has no scope for fails with insufficient_scope. A script cannot do more than the connection already may.

Costs are the same too, and a loop multiplies them. A script that calls POST /v1/assistants/{assistant_id}/query 100 times asks 100 questions and spends the credits of 100 answers. Limit the query scope on connections you give to Code Mode, and tell the agent to ask before it loops over questions.

What a script cannot do

  • Open a network connection. There is no fetch and no file system. request() is the only way out.
  • Upload a file, which needs a streamed body, or stream an answer.
  • Set headers, including Idempotency-Key.
  • Reach the engine, the database or another workspace.

Connecting

Connect to the Code Mode URL the same way as the standard server. See Connect an AI client. A token requested for the standard server only is refused here, and the reverse. A token requested with no resource works for both.

The sandbox is a boundary against the code, not against the content. Text from your resources flows back to the agent and can try to influence the next script. What bounds that is the reach of the connection, so give it narrow scopes. See Safety and permissions.

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search Lookio Docs documentation and read it in full, instead of answering from memory.

https://lookio.app/docs/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://lookio.app/docs/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.