Skip to main content
Glama
lithtrix

lithtrix-mcp

Official

lithtrix_browse

Fetch public web pages with server-side browsing for AI agents. Supports static and dynamic modes while enforcing robots.txt and returning text extracts.

Instructions

Pay to be fully autonomous: server-side public web access for agents. POST /v1/browse with url and optional mode (static | dynamic). Robots.txt is enforced. Returns browse_id, final_url, text extract, and _lithtrix (browse_url, usage on free tier). Requires LITHTRIX_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesPublic http(s) URL to fetch
modeNoFetch mode: "static" (HTTP GET) or "dynamic" (rendered HTML)static

Implementation Reference

  • The async handler function that calls the Lithtrix API /v1/browse endpoint. It validates the API key, sends a POST request with url and mode (static/dynamic), and returns the response or an error.
        async ({ url, mode = "static" }) => {
          const apiKey = process.env.LITHTRIX_API_KEY;
          if (!apiKey) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({
                    error:
                      "LITHTRIX_API_KEY environment variable is not set. " +
                      "Register at https://lithtrix.ai to get an API key.",
                  }),
                },
              ],
              isError: true,
            };
          }
    
          const reqUrl = new URL("/v1/browse", LITHTRIX_API_URL);
          let response;
          try {
            response = await fetch(reqUrl.toString(), {
              method: "POST",
              headers: {
                Authorization: `Bearer ${apiKey}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({ url, mode }),
            });
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({
                    error: `Network error contacting Lithtrix API: ${err.message}`,
                  }),
                },
              ],
              isError: true,
            };
          }
    
          const body = await response.json();
    
          if (!response.ok) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({
                    error: body.message ?? `Lithtrix API error (HTTP ${response.status})`,
                    error_code: body.error_code ?? "UNKNOWN",
                  }),
                },
              ],
              isError: true,
            };
          }
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(body, null, 2),
              },
            ],
          };
        }
      );
    }
  • Zod schemas for the tool parameters: url (required string, min 1 max 8192) and mode (optional enum static/dynamic, defaults to 'static').
    {
      url: z
        .string()
        .min(1)
        .max(8192)
        .describe("Public http(s) URL to fetch"),
      mode: z
        .enum(["static", "dynamic"])
        .optional()
        .default("static")
        .describe('Fetch mode: "static" (HTTP GET) or "dynamic" (rendered HTML)'),
    },
  • tools/browse.js:12-101 (registration)
    The registerBrowseTool function registers the 'lithtrix_browse' tool on the MCP server with its description, schema, and handler.
    export function registerBrowseTool(server) {
      server.tool(
        "lithtrix_browse",
        "Pay to be fully autonomous: server-side public web access for agents. " +
          "POST /v1/browse with url and optional mode (static | dynamic). " +
          "Robots.txt is enforced. Returns browse_id, final_url, text extract, and _lithtrix (browse_url, usage on free tier). " +
          "Requires LITHTRIX_API_KEY.",
        {
          url: z
            .string()
            .min(1)
            .max(8192)
            .describe("Public http(s) URL to fetch"),
          mode: z
            .enum(["static", "dynamic"])
            .optional()
            .default("static")
            .describe('Fetch mode: "static" (HTTP GET) or "dynamic" (rendered HTML)'),
        },
        async ({ url, mode = "static" }) => {
          const apiKey = process.env.LITHTRIX_API_KEY;
          if (!apiKey) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({
                    error:
                      "LITHTRIX_API_KEY environment variable is not set. " +
                      "Register at https://lithtrix.ai to get an API key.",
                  }),
                },
              ],
              isError: true,
            };
          }
    
          const reqUrl = new URL("/v1/browse", LITHTRIX_API_URL);
          let response;
          try {
            response = await fetch(reqUrl.toString(), {
              method: "POST",
              headers: {
                Authorization: `Bearer ${apiKey}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({ url, mode }),
            });
          } catch (err) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({
                    error: `Network error contacting Lithtrix API: ${err.message}`,
                  }),
                },
              ],
              isError: true,
            };
          }
    
          const body = await response.json();
    
          if (!response.ok) {
            return {
              content: [
                {
                  type: "text",
                  text: JSON.stringify({
                    error: body.message ?? `Lithtrix API error (HTTP ${response.status})`,
                    error_code: body.error_code ?? "UNKNOWN",
                  }),
                },
              ],
              isError: true,
            };
          }
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(body, null, 2),
              },
            ],
          };
        }
      );
    }
  • index.js:37-52 (registration)
    Import of registerBrowseTool from tools/browse.js, and its invocation on line 51 to register the tool on the server.
    import { registerBrowseTool } from "./tools/browse.js";
    import { registerCommonsTool } from "./tools/commons.js";
    
    const server = new McpServer({
      name: "lithtrix",
      version: "0.9.0",
    });
    
    registerSearchTool(server);
    registerRegisterTool(server);
    registerMemoryTools(server);
    registerBlobTools(server);
    registerParseTools(server);
    registerFeedbackTool(server);
    registerBrowseTool(server);
    registerCommonsTool(server);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses robots.txt enforcement, API key requirement, and return fields. However, it does not detail error handling, rate limits, or failure modes, leaving gaps for a tool that involves web fetching.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences but the first sentence ('Pay to be fully autonomous') is vague and not immediately clear. The structure could be improved by placing the endpoint and purpose first. Overall, it is concise but not optimally front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 parameters, no output schema), the description covers essential aspects: purpose, endpoint, parameters, returns, authentication, and robots.txt behavior. It is reasonably complete for an agent to understand usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds minimal value over the schema. It repeats the endpoint and mode options but does not provide additional semantic context beyond what the property descriptions already give.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool provides server-side public web access for agents, specifying the endpoint POST /v1/browse and parameters. It is distinct from all sibling tools (blob, memory, search, etc.), so the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no explicit when-to-use or alternatives are given, the sibling set is diverse, making the browse tool's context clear. The description mentions a prerequisite (API key) and a pricing model, but lacks guidance on when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lithtrix/lithtrix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server