Skip to main content
Glama
lithtrix

lithtrix-mcp

Official

lithtrix_commons_read

List opt-in shared public memory entries from the Lithtrix Commons pool. Use pagination to navigate results.

Instructions

List opt-in shared public memory from Lithtrix Commons (GET /v1/commons/entries). Requires LITHTRIX_API_KEY. Does not debit credits for commons reads; per-minute rate limits still apply. Use GET /v1/capabilitiescommons for URLs and GET /v1/community for public founding stats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (1-based, default 1)
per_pageNoPage size (1–100, default 20)

Implementation Reference

  • Async handler function that fetches GET /v1/commons/entries. Checks LITHTRIX_API_KEY, constructs URL with pagination params, sends Bearer auth request to Lithtrix API, returns parsed JSON response or error.
    async ({ page = 1, per_page = 20 }) => {
      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 with lithtrix_register or POST /v1/register first.",
              }),
            },
          ],
          isError: true,
        };
      }
    
      const url = new URL("/v1/commons/entries", LITHTRIX_API_URL);
      url.searchParams.set("page", String(page));
      url.searchParams.set("per_page", String(per_page));
    
      let response;
      try {
        response = await fetch(url.toString(), {
          headers: {
            Authorization: `Bearer ${apiKey}`,
            Accept: "application/json",
          },
        });
      } 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 schema defining optional 'page' (int, min 1) and 'per_page' (int, min 1, max 100) input parameters.
    {
      page: z
        .number()
        .int()
        .min(1)
        .optional()
        .describe("Page number (1-based, default 1)"),
      per_page: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Page size (1–100, default 20)"),
    },
  • registerCommonsTool function registers the tool named 'lithtrix_commons_read' on the MCP server via server.tool(...).
    export function registerCommonsTool(server) {
      server.tool(
        "lithtrix_commons_read",
        "List opt-in shared public memory from Lithtrix Commons (`GET /v1/commons/entries`). " +
          "Requires `LITHTRIX_API_KEY`. Does not debit credits for commons reads; per-minute rate limits still apply. " +
          "Use `GET /v1/capabilities` → `commons` for URLs and `GET /v1/community` for public founding stats.",
        {
          page: z
            .number()
            .int()
            .min(1)
            .optional()
            .describe("Page number (1-based, default 1)"),
          per_page: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Page size (1–100, default 20)"),
        },
        async ({ page = 1, per_page = 20 }) => {
          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 with lithtrix_register or POST /v1/register first.",
                  }),
                },
              ],
              isError: true,
            };
          }
    
          const url = new URL("/v1/commons/entries", LITHTRIX_API_URL);
          url.searchParams.set("page", String(page));
          url.searchParams.set("per_page", String(per_page));
    
          let response;
          try {
            response = await fetch(url.toString(), {
              headers: {
                Authorization: `Bearer ${apiKey}`,
                Accept: "application/json",
              },
            });
          } 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:38-52 (registration)
    Import and invocation of registerCommonsTool(server) from tools/commons.js, which wires the tool into the MCP server.
    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);
Behavior4/5

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

No annotations provided, so the description carries the full burden. It discloses requirements (API key), cost (no credits, rate limits apply), and the nature of the resource (opt-in shared public memory). However, it does not explicitly state that the tool is read-only, though that is implied. Still, it is fairly transparent.

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

Conciseness5/5

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

The description is concise with three sentences: one stating the main purpose and two directing to alternatives. No extraneous information, front-loaded with the key action.

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

Completeness3/5

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

The tool is a simple paginated list with no output schema. The description explains how to paginate but does not describe the return value structure (e.g., what fields are in each entry). For a list tool, mentioning the return format would improve completeness, but the description gives enough context for basic use.

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?

The input schema has 100% coverage for both parameters (page and per_page), with types, constraints, and descriptions. The description adds no new semantics beyond the schema, so baseline 3 is appropriate.

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 states the tool lists opt-in shared public memory from Lithtrix Commons, specifying the HTTP method and path. It clearly distinguishes from sibling tools like lithtrix_search and lithtrix_memory_* by focusing on public memory, and references alternative endpoints for related info.

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

Usage Guidelines5/5

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

The description explicitly tells when to use this tool (list public memory), what it requires (API key), and where to go for other commons info (capabilities for URLs, community for stats). It also mentions credit and rate limit behavior, providing clear usage boundaries.

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