Lookio Docs
Lookio websiteOpen Lookio
MCP serverCode Mode
MCP server

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 when they write code than when they chain many tool calls.

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

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

ToolWhat it does
searchFinds API operations. The agent sends a JavaScript filter that runs on the API description in the sandbox. Without a filter, it returns all operations in short form: a few hundred tokens.
executeRuns a JavaScript program with a request() function that calls the API.

The API description stays in the sandbox and does not fill the agent’s context.

Calling the API

In execute, request({ method, path, query, body }) calls an endpoint and returns the parsed response: { data, request_id }, and has_more and next_cursor for a list. A failed call throws an Error with 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 or logs with console.log goes back to the agent. Filter and summarise in the script. Do not 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, like the HTTP call.

Same permissions, same costs

Code Mode uses the same routes, checks and scopes as an HTTP request. A path without its scope fails with insufficient_scope. A script cannot do more than the connection.

Costs are the same, and a loop multiplies them: 100 calls to POST /v1/assistants/{assistant_id}/query cost 100 answers. Do not grant query to a Code Mode connection without need, 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 or stream an answer.
  • Set headers, including Idempotency-Key.
  • Reach the engine, the database or another workspace.

Connecting

Connect to the Code Mode URL like the standard server. See Connect an AI client. A token for the standard server only does not work here, and the reverse. A token without resource works for both.

The sandbox protects against the code, not against the content. Text from your resources goes back to the agent and can try to change the next script. Narrow scopes limit the risk. 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.